aQute.bnd.osgi.Analyzer.getTypeRefFromPath()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中aQute.bnd.osgi.Analyzer.getTypeRefFromPath()方法的一些代码示例,展示了Analyzer.getTypeRefFromPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.getTypeRefFromPath()方法的具体详情如下:
包路径:aQute.bnd.osgi.Analyzer
类名称:Analyzer
方法名:getTypeRefFromPath

Analyzer.getTypeRefFromPath介绍

暂无

代码示例

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

private boolean hasSource(Analyzer analyzer, String path) throws Exception {
  if (!path.endsWith(".class"))
    return false;
  TypeRef type = analyzer.getTypeRefFromPath(path);
  PackageRef packageRef = type.getPackageRef();
  Clazz clazz = analyzer.findClass(type);
  if (clazz == null)
    return false;
  String sourceFile = clazz.getSourceFile();
  if (sourceFile == null)
    return false;
  String source = "OSGI-OPT/src/" + packageRef.getBinary() + "/" + sourceFile;
  Resource sourceResource = analyzer.getJar()
    .getResource(source);
  if (sourceResource == null)
    return false;
  return true;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

private boolean hasSource(Analyzer analyzer, String path) throws Exception {
  if (!path.endsWith(".class"))
    return false;
  TypeRef type = analyzer.getTypeRefFromPath(path);
  PackageRef packageRef = type.getPackageRef();
  Clazz clazz = analyzer.findClass(type);
  if (clazz == null)
    return false;
  String sourceFile = clazz.getSourceFile();
  if (sourceFile == null)
    return false;
  String source = "OSGI-OPT/src/" + packageRef.getBinary() + "/" + sourceFile;
  Resource sourceResource = analyzer.getJar()
    .getResource(source);
  if (sourceResource == null)
    return false;
  return true;
}

代码示例来源:origin: biz.aQute.bnd/bnd

Resource r = entry.getValue();
if (key.endsWith(".class")) {
  TypeRef ref = analyzer.getTypeRefFromPath(key);
  if (filter.matches(ref.toString())) {
    set.add(ref);

相关文章

Analyzer类方法