本文整理了Java中aQute.bnd.osgi.Analyzer.getPackageRef()
方法的一些代码示例,展示了Analyzer.getPackageRef()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.getPackageRef()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Analyzer
类名称:Analyzer
方法名:getPackageRef
暂无
代码示例来源:origin: biz.aQute/bndlib
public boolean analyzeJar(Analyzer analyzer) throws Exception {
Jar jar = analyzer.getJar();
Map<String,Resource> dir = jar.getDirectories().get("META-INF/spring");
if (dir == null || dir.isEmpty())
return false;
for (Iterator<Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
Entry<String,Resource> entry = i.next();
String path = entry.getKey();
Resource resource = entry.getValue();
if (SPRING_SOURCE.matcher(path).matches()) {
try {
InputStream in = resource.openInputStream();
Set<CharSequence> set = analyze(in);
in.close();
for (Iterator<CharSequence> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef((String) r.next());
if (!QN.matcher(pack.getFQN()).matches())
analyzer.warning("Package does not seem a package in spring resource (" + path + "): "
+ pack);
if (!analyzer.getReferred().containsKey(pack))
analyzer.getReferred().put(pack, new Attrs());
}
}
catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(" + path + "): " + e);
}
}
}
return false;
}
代码示例来源:origin: biz.aQute.bnd/bndlib
public boolean analyzeJar(Analyzer analyzer) throws Exception {
Jar jar = analyzer.getJar();
Map<String,Resource> dir = jar.getDirectories().get("META-INF/spring");
if (dir == null || dir.isEmpty())
return false;
for (Iterator<Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
Entry<String,Resource> entry = i.next();
String path = entry.getKey();
Resource resource = entry.getValue();
if (SPRING_SOURCE.matcher(path).matches()) {
try {
InputStream in = resource.openInputStream();
Set<CharSequence> set = analyze(in);
in.close();
for (Iterator<CharSequence> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef((String) r.next());
if (!QN.matcher(pack.getFQN()).matches())
analyzer.warning("Package does not seem a package in spring resource (" + path + "): "
+ pack);
if (!analyzer.getReferred().containsKey(pack))
analyzer.getReferred().put(pack, new Attrs());
}
}
catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(" + path + "): " + e);
}
}
}
return false;
}
代码示例来源:origin: biz.aQute/bndlib
private void process(Analyzer analyzer, String path, Resource resource) {
try {
InputStream in = resource.openInputStream();
Set<String> set = analyze(in);
in.close();
for (Iterator<String> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef(r.next());
if (!QN.matcher(pack.getFQN()).matches())
analyzer.warning("Package does not seem a package in spring resource (" + path + "): " + pack);
if (!analyzer.getReferred().containsKey(pack))
analyzer.getReferred().put(pack);
}
}
catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(" + path + "): " + e);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
private void process(Analyzer analyzer, String path, Resource resource) {
try {
InputStream in = resource.openInputStream();
Set<String> set = analyze(in);
in.close();
for (Iterator<String> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef(r.next());
if (!QN.matcher(pack.getFQN()).matches())
analyzer.warning("Package does not seem a package in spring resource (" + path + "): " + pack);
if (!analyzer.getReferred().containsKey(pack))
analyzer.getReferred().put(pack);
}
}
catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(" + path + "): " + e);
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
public boolean analyzeJar(Analyzer analyzer) throws Exception {
Jar jar = analyzer.getJar();
Map<String,Resource> dir = jar.getDirectories().get("META-INF/spring");
if (dir == null || dir.isEmpty())
return false;
for (Iterator<Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
Entry<String,Resource> entry = i.next();
String path = entry.getKey();
Resource resource = entry.getValue();
if (SPRING_SOURCE.matcher(path).matches()) {
try {
InputStream in = resource.openInputStream();
Set<CharSequence> set = analyze(in);
in.close();
for (Iterator<CharSequence> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef((String) r.next());
if (!QN.matcher(pack.getFQN()).matches())
analyzer.warning("Package does not seem a package in spring resource (" + path + "): "
+ pack);
if (!analyzer.getReferred().containsKey(pack))
analyzer.getReferred().put(pack, new Attrs());
}
}
catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(" + path + "): " + e);
}
}
}
return false;
}
代码示例来源:origin: biz.aQute.bnd/bnd
private void process(Analyzer analyzer, String path, Resource resource) {
try {
InputStream in = resource.openInputStream();
Set<String> set = analyze(in);
in.close();
for (Iterator<String> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef(r.next());
if (!QN.matcher(pack.getFQN()).matches())
analyzer.warning("Package does not seem a package in spring resource (" + path + "): " + pack);
if (!analyzer.getReferred().containsKey(pack))
analyzer.getReferred().put(pack);
}
}
catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(" + path + "): " + e);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
PackageRef pack = analyzer.getPackageRef((String) r.next());
if (!QN.matcher(pack.getFQN())
.matches())
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
PackageRef pack = analyzer.getPackageRef((String) r.next());
if (!QN.matcher(pack.getFQN())
.matches())
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void process(Analyzer analyzer, String path, Resource resource) {
try {
Set<String> set;
try (InputStream in = resource.openInputStream()) {
set = analyze(in);
}
for (Iterator<String> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef(r.next());
if (!QN.matcher(pack.getFQN())
.matches())
analyzer.warning("Package does not seem a package in spring resource (%s): %s", path, pack);
if (!analyzer.getReferred()
.containsKey(pack))
analyzer.getReferred()
.put(pack);
}
} catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(%s): %s", path, e);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
private void process(Analyzer analyzer, String path, Resource resource) {
try {
Set<String> set;
try (InputStream in = resource.openInputStream()) {
set = analyze(in);
}
for (Iterator<String> r = set.iterator(); r.hasNext();) {
PackageRef pack = analyzer.getPackageRef(r.next());
if (!QN.matcher(pack.getFQN())
.matches())
analyzer.warning("Package does not seem a package in spring resource (%s): %s", path, pack);
if (!analyzer.getReferred()
.containsKey(pack))
analyzer.getReferred()
.put(pack);
}
} catch (Exception e) {
analyzer.error("Unexpected exception in processing spring resources(%s): %s", path, e);
}
}
代码示例来源:origin: biz.aQute/bndlib
/**
* @param jar
*/
private void getExternalExports(Jar jar, Packages classpathExports) {
try {
Manifest m = jar.getManifest();
if (m != null) {
Domain domain = Domain.domain(m);
Parameters exported = domain.getExportPackage();
for (Entry<String,Attrs> e : exported.entrySet()) {
PackageRef ref = getPackageRef(e.getKey());
if (!classpathExports.containsKey(ref)) {
// TODO e.getValue().put(SOURCE_DIRECTIVE,
// jar.getBsn()+"-"+jar.getVersion());
classpathExports.put(ref, e.getValue());
}
}
}
}
catch (Exception e) {
warning("Erroneous Manifest for " + jar + " " + e);
}
}
代码示例来源:origin: biz.aQute/bndlib
for (Map.Entry<String,Attrs> entry : OSGiHeader.parseHeader(
manifest.getMainAttributes().getValue(Constants.EXPORT_PACKAGE)).entrySet())
exports.put(analyzer.getPackageRef(entry.getKey()), entry.getValue());
} else
exports = analyzer.getContained();
代码示例来源:origin: biz.aQute.bnd/bndlib
for (Map.Entry<String,Attrs> entry : OSGiHeader.parseHeader(
manifest.getMainAttributes().getValue(Constants.EXPORT_PACKAGE)).entrySet())
exports.put(analyzer.getPackageRef(entry.getKey()), entry.getValue());
} else
exports = analyzer.getContained();
代码示例来源:origin: biz.aQute.bnd/bnd
for (Map.Entry<String,Attrs> entry : OSGiHeader.parseHeader(
manifest.getMainAttributes().getValue(Constants.EXPORT_PACKAGE)).entrySet())
exports.put(analyzer.getPackageRef(entry.getKey()), entry.getValue());
} else
exports = analyzer.getContained();
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
.getValue(Constants.EXPORT_PACKAGE))
.entrySet())
exports.put(analyzer.getPackageRef(entry.getKey()), entry.getValue());
} else
exports = analyzer.getContained();
代码示例来源:origin: biz.aQute.bnd/bndlib
Parameters exported = domain.getExportPackage();
for (Entry<String,Attrs> e : exported.entrySet()) {
PackageRef ref = getPackageRef(e.getKey());
if (!classpathExports.containsKey(ref)) {
代码示例来源:origin: biz.aQute.bnd/bnd
Parameters exported = domain.getExportPackage();
for (Entry<String,Attrs> e : exported.entrySet()) {
PackageRef ref = getPackageRef(e.getKey());
if (!classpathExports.containsKey(ref)) {
代码示例来源:origin: biz.aQute.bnd/bndlib
contracted.add(analyzer.getPackageRef(pname), c);
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
Parameters exported = domain.getExportPackage();
for (Entry<String, Attrs> e : exported.entrySet()) {
PackageRef ref = getPackageRef(e.getKey());
if (!classpathExports.containsKey(ref)) {
e.getValue()
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
Parameters exported = domain.getExportPackage();
for (Entry<String, Attrs> e : exported.entrySet()) {
PackageRef ref = getPackageRef(e.getKey());
if (!classpathExports.containsKey(ref)) {
e.getValue()
内容来源于网络,如有侵权,请联系作者删除!