Package aQute.bnd.osgi.Descriptors

Examples of aQute.bnd.osgi.Descriptors.PackageRef


    if (bactivator != null) {
      TypeRef ref = analyzer.getTypeRefFromFQN(bactivator);
      if (analyzer.getClassspace().containsKey(ref))
        return;

      PackageRef packageRef = ref.getPackageRef();
      if (packageRef.isDefaultPackage())
        error("The Bundle Activator is not in the bundle and it is in the default package ");
      else if (!analyzer.isImported(packageRef)) {
        error("Bundle-Activator not found on the bundle class path nor in imports: " + bactivator);
      }
    }
View Full Code Here


    unresolvedReferences.removeAll(analyzer.getImports().keySet());
    unresolvedReferences.removeAll(analyzer.getContained().keySet());

    // Remove any java.** packages.
    for (Iterator<PackageRef> p = unresolvedReferences.iterator(); p.hasNext();) {
      PackageRef pack = p.next();
      if (pack.isJava())
        p.remove();
      else {
        // Remove any dynamic imports
        if (isDynamicImport(pack))
          p.remove();
View Full Code Here

      return;

    Set<PackageRef> packages = Create.set();

    for (TypeRef typeRef : getClassspace().keySet()) {
      PackageRef packageRef = typeRef.getPackageRef();
      String sourcePath = typeRef.getSourcePath();
      String packagePath = packageRef.getPath();

      boolean found = false;
      String[] fixed = {
          "packageinfo", "package.html", "module-info.java", "package-info.java"
      };

      for (Iterator<File> i = getSourcePath().iterator(); i.hasNext();) {
        File root = i.next();

        // TODO should use bcp?

        File f = getFile(root, sourcePath);
        if (f.exists()) {
          found = true;
          if (!packages.contains(packageRef)) {
            packages.add(packageRef);
            File bdir = getFile(root, packagePath);
            for (int j = 0; j < fixed.length; j++) {
              File ff = getFile(bdir, fixed[j]);
              if (ff.isFile()) {
                String name = "OSGI-OPT/src/" + packagePath + "/" + fixed[j];
                dot.putResource(name, new FileResource(ff));
              }
            }
          }
          if (packageRef.isDefaultPackage())
            System.err.println("Duh?");
          dot.putResource("OSGI-OPT/src/" + sourcePath, new FileResource(f));
        }
      }
      if (!found) {
View Full Code Here

      for (Iterator<Entry<String,List<Jar>>> entry = index.entrySet().iterator(); entry.hasNext();) {
        Entry<String,List<Jar>> p = entry.next();

        String directory = p.getKey();
        PackageRef packageRef = getPackageRef(directory);

        // Skip * and meta data, we're talking packages!
        if (packageRef.isMetaData() && instruction.isAny())
          continue;

        if (!instruction.matches(packageRef.getFQN()))
          continue;

        // Ensure it is never matched again
        entry.remove();

View Full Code Here

    if (xref != null)
      xref.add(typeRef);
    if (typeRef.isPrimitive())
      return;

    PackageRef packageRef = typeRef.getPackageRef();
    if (packageRef.isPrimitivePackage())
      return;

    imports.add(packageRef);

    if (api != null && (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)))
View Full Code Here

    packages = new MultiMap<PackageRef,Element>();

    for (Clazz c : analyzer.getClassspace().values()) {
      if (c.isPublic() || c.isProtected()) {
        PackageRef packageName = c.getClassName().getPackageRef();

        if (exports.containsKey(packageName)) {
          Element cdef = classElement(c);
          packages.add(packageName, cdef);
        }
View Full Code Here

      return;

    Set<PackageRef> packages = Create.set();

    for (TypeRef typeRef : getClassspace().keySet()) {
      PackageRef packageRef = typeRef.getPackageRef();
      String sourcePath = typeRef.getSourcePath();
      String packagePath = packageRef.getPath();

      boolean found = false;
      String[] fixed = {
          "packageinfo", "package.html", "module-info.java", "package-info.java"
      };

      for (Iterator<File> i = getSourcePath().iterator(); i.hasNext();) {
        File root = i.next();

        // TODO should use bcp?

        File f = getFile(root, sourcePath);
        if (f.exists()) {
          found = true;
          if (!packages.contains(packageRef)) {
            packages.add(packageRef);
            File bdir = getFile(root, packagePath);
            for (int j = 0; j < fixed.length; j++) {
              File ff = getFile(bdir, fixed[j]);
              if (ff.isFile()) {
                String name = "OSGI-OPT/src/" + packagePath + "/" + fixed[j];
                dot.putResource(name, new FileResource(ff));
              }
            }
          }
          if (packageRef.isDefaultPackage())
            System.err.println("Duh?");
          dot.putResource("OSGI-OPT/src/" + sourcePath, new FileResource(f));
        }
      }
      if (!found) {
View Full Code Here

      for (Iterator<Entry<String,List<Jar>>> entry = index.entrySet().iterator(); entry.hasNext();) {
        Entry<String,List<Jar>> p = entry.next();

        String directory = p.getKey();
        PackageRef packageRef = getPackageRef(directory);

        // Skip * and meta data, we're talking packages!
        if (packageRef.isMetaData() && instruction.isAny())
          continue;

        if (!instruction.matches(packageRef.getFQN()))
          continue;

        // Ensure it is never matched again
        entry.remove();

View Full Code Here

    if (bactivator != null) {
      TypeRef ref = analyzer.getTypeRefFromFQN(bactivator);
      if (analyzer.getClassspace().containsKey(ref))
        return;

      PackageRef packageRef = ref.getPackageRef();
      if (packageRef.isDefaultPackage())
        error("The Bundle Activator is not in the bundle and it is in the default package ");
      else if (!analyzer.isImported(packageRef)) {
        error("Bundle-Activator not found on the bundle class path nor in imports: " + bactivator);
      }
    }
View Full Code Here

    unresolvedReferences.removeAll(analyzer.getImports().keySet());
    unresolvedReferences.removeAll(analyzer.getContained().keySet());

    // Remove any java.** packages.
    for (Iterator<PackageRef> p = unresolvedReferences.iterator(); p.hasNext();) {
      PackageRef pack = p.next();
      if (pack.isJava())
        p.remove();
      else {
        // Remove any dynamic imports
        if (isDynamicImport(pack))
          p.remove();
View Full Code Here

TOP

Related Classes of aQute.bnd.osgi.Descriptors.PackageRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.