Package aQute.bnd.osgi.Descriptors

Examples of aQute.bnd.osgi.Descriptors.PackageRef


                        else
                        {
                            continue;
                        }
                    }
                    PackageRef pkgRef = analyzer.getPackageRef( pkg );
                    if ( !analyzer.getReferred().containsKey( pkgRef ) )
                    {
                        Attrs attrs = analyzer.getReferred().put(pkgRef);
                        for (Attribute attribute : a.getAttributes())
                        {
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(Constants.BUNDLE_ACTIVATOR + " not found on the bundle class path nor in imports: " + bactivator);
      }
    }
View Full Code Here

    Domain domain = Domain.domain(m);
   
    Set<PackageRef> unresolvedReferences = new TreeSet<PackageRef>(analyzer.getReferred().keySet());
    unresolvedReferences.removeAll(analyzer.getContained().keySet());
    for ( String pname : domain.getImportPackage().keySet()) {
      PackageRef pref = analyzer.getPackageRef(pname);
      unresolvedReferences.remove(pref);
    }

    // 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

    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

    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

        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());
          }
View Full Code Here

    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);
      }
    }
View Full Code Here

   * @return
   */
  public Set<PackageRef> getUnreachable() {
    Set<PackageRef> unreachable = new HashSet<PackageRef>(uses.keySet()); // all
    for (Iterator<PackageRef> r = exports.keySet().iterator(); r.hasNext();) {
      PackageRef packageRef = r.next();
      removeTransitive(packageRef, unreachable);
    }
    if (activator != null) {
      removeTransitive(activator.getPackageRef(), unreachable);
    }
View Full Code Here

    // the used packages for each exported package to find out
    // if it refers to an internal package.
    //

    for (Iterator<PackageRef> i = toBeImported.iterator(); i.hasNext();) {
      PackageRef next = i.next();
      Collection<PackageRef> usedByExportedPackage = this.uses.get(next);

      // We had an NPE on usedByExportedPackage in GF.
      // I guess this can happen with hard coded
      // imports that do not match reality ...
      if (usedByExportedPackage == null || usedByExportedPackage.isEmpty()) {
        continue;
      }

      for (PackageRef privatePackage : privatePackages) {
        if (usedByExportedPackage.contains(privatePackage)) {
          i.remove();
          break;
        }
      }
    }

    // Clean up attributes and generate result map
    Packages result = new Packages();
    for (Iterator<PackageRef> i = toBeImported.iterator(); i.hasNext();) {
      PackageRef ep = i.next();
      Attrs parameters = exports.get(ep);

      String noimport = parameters == null ? null : parameters.get(NO_IMPORT_DIRECTIVE);
      if (noimport != null && noimport.equalsIgnoreCase("true"))
        continue;
View Full Code Here

      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());
            Attrs attrs = e.getValue();
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.