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

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

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

Analyzer.getSourceFileFor介绍

[英]Find the source file for this type
[中]查找此类型的源文件

代码示例

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

/**
 * Find the source file for this type
 * 
 * @param type
 * @throws Exception
 */
public String getSourceFileFor(TypeRef type) throws Exception {
  Set<File> sp = Collections.singleton(getFile(getProperty(DEFAULT_PROP_SRC_DIR, "src")));
  return getSourceFileFor(type, sp);
}

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

/**
 * Find the source file for this type
 * 
 * @param type
 * @throws Exception
 */
public String getSourceFileFor(TypeRef type) throws Exception {
  Set<File> sp = Collections.singleton(getFile(getProperty(DEFAULT_PROP_SRC_DIR, "src")));
  return getSourceFileFor(type, sp);
}

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

/**
 * Set location information for a type.
 */
public void setTypeLocation(SetLocation location, TypeRef type) throws Exception {
  String sf = getSourceFileFor(type);
  if (sf != null) {
    File sff = IO.getFile(sf);
    if (sff != null) {
      String names[] = {
        type.getShorterName(), type.getFQN(), type.getShortName()
          .replace('$', '.')
      };
      for (String name : names) {
        FileLine fl = Processor.findHeader(sff,
          Pattern.compile("(class|interface)\\s*" + name, Pattern.DOTALL));
        if (fl != null)
          fl.set(location);
      }
    }
    location.file(sf);
  }
}

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

/**
 * Set location information for a type.
 */
public void setTypeLocation(SetLocation location, TypeRef type) throws Exception {
  String sf = getSourceFileFor(type);
  if (sf != null) {
    File sff = IO.getFile(sf);
    if (sff != null) {
      String names[] = {
        type.getShorterName(), type.getFQN(), type.getShortName()
          .replace('$', '.')
      };
      for (String name : names) {
        FileLine fl = Processor.findHeader(sff,
          Pattern.compile("(class|interface)\\s*" + name, Pattern.DOTALL));
        if (fl != null)
          fl.set(location);
      }
    }
    location.file(sf);
  }
}

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

clazz.getFQN());
TypeRef cname = clazz.getClassName();
String source = analyzer.getSourceFileFor(cname);
if (source != null) {
  File f = getFile(source);

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

clazz.getFQN());
TypeRef cname = clazz.getClassName();
String source = analyzer.getSourceFileFor(cname);
if (source != null) {
  File f = getFile(source);

相关文章

Analyzer类方法