コード例 #1
0
  public void analyzeResource(
      IndexableResource resource, List<Capability> capabilities, List<Requirement> requirements)
      throws Exception {
    boolean blueprintEnabled = false;

    String header = resource.getManifest().getMainAttributes().getValue(BUNDLE_BLUEPRINT_HEADER);
    if (header != null) {
      blueprintEnabled = true;
    } else {
      List<String> children = resource.listChildren("OSGI-INF/blueprint/");
      if (children != null) {
        for (String child : children) {
          if (child.toLowerCase().endsWith(".xml")) {
            blueprintEnabled = true;
            break;
          }
        }
      }
    }

    if (blueprintEnabled) requirements.add(createRequirement());
  }
コード例 #2
0
ファイル: WibbleAnalyzer.java プロジェクト: rkrzewski/bindex
 public void analyzeResource(
     IndexableResource resource, List<Capability> capabilities, List<Requirement> requirements)
     throws Exception {
   capabilities.add(resource.newBuilder().setNamespace("wibble").buildCapability());
 }