Class ResourceBuilder


  • public class ResourceBuilder
    extends java.lang.Object
    • Constructor Detail

      • ResourceBuilder

        public ResourceBuilder​(org.osgi.resource.Resource source)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ResourceBuilder

        public ResourceBuilder()
    • Method Detail

      • addCapability

        public ResourceBuilder addCapability​(org.osgi.resource.Capability capability)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addCapability0

        public org.osgi.resource.Capability addCapability0​(CapReqBuilder builder)
      • addRequirement

        public ResourceBuilder addRequirement​(org.osgi.resource.Requirement requirement)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • build

        public org.osgi.resource.Resource build()
      • getCapabilities

        public java.util.List<org.osgi.resource.Capability> getCapabilities()
      • addManifest

        public boolean addManifest​(Domain manifest)
                            throws java.lang.Exception
        Parse the manifest and turn them into requirements & capabilities
        Parameters:
        manifest - The manifest to parse
        Throws:
        java.lang.Exception
      • addExportServices

        public void addExportServices​(Parameters exportServices)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addImportServices

        public void addImportServices​(Parameters importServices)
      • getNativeCode

        public RequirementBuilder getNativeCode​(java.lang.String header)
                                         throws java.lang.Exception
        Caclulate the requirement from a native code header
        Parameters:
        header - the Bundle-NativeCode header or null
        Returns:
        a Requirement Builder set to the requirements according tot he core spec
        Throws:
        java.lang.Exception
      • addRequireBundles

        public void addRequireBundles​(Parameters requireBundle)
                               throws java.lang.Exception
        Add the Require-Bundle header
        Throws:
        java.lang.Exception
      • addRequireBundle

        public void addRequireBundle​(java.lang.String bsn,
                                     VersionRange range)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addRequireBundle

        public void addRequireBundle​(java.lang.String bsn,
                                     Attrs attrs)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addFragmentHost

        public void addFragmentHost​(java.lang.String bsn,
                                    Attrs attrs)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addRequireCapabilities

        public void addRequireCapabilities​(Parameters required)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addRequireCapability

        public void addRequireCapability​(java.lang.String namespace,
                                         java.lang.String name,
                                         Attrs attrs)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addProvideCapabilities

        public java.util.List<org.osgi.resource.Capability> addProvideCapabilities​(Parameters capabilities)
                                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addProvideCapabilities

        public java.util.List<org.osgi.resource.Capability> addProvideCapabilities​(java.lang.String clauses)
                                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addProvideCapability

        public org.osgi.resource.Capability addProvideCapability​(java.lang.String namespace,
                                                                 Attrs attrs)
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addExportPackages

        public void addExportPackages​(Parameters exports)
                               throws java.lang.Exception
        Add Exported Packages
        Throws:
        java.lang.Exception
      • addEE

        public void addEE​(EE ee)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addExportPackage

        public void addExportPackage​(java.lang.String packageName,
                                     Attrs attrs)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addImportPackages

        public void addImportPackages​(Parameters imports)
                               throws java.lang.Exception
        Add imported packages
        Throws:
        java.lang.Exception
      • addImportPackage

        public org.osgi.resource.Requirement addImportPackage​(java.lang.String pname,
                                                              Attrs attrs)
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addExecutionEnvironment

        public void addExecutionEnvironment​(EE ee)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addAllExecutionEnvironments

        public void addAllExecutionEnvironments​(EE ee)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • copyCapabilities

        public void copyCapabilities​(java.util.Set<java.lang.String> ignoreNamespaces,
                                     org.osgi.resource.Resource r)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addCapabilities

        public void addCapabilities​(java.util.List<org.osgi.resource.Capability> capabilities)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addRequirement

        public void addRequirement​(java.util.List<org.osgi.resource.Requirement> requirements)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addRequirements

        public void addRequirements​(java.util.List<org.osgi.resource.Requirement> requires)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • findCapabilities

        public java.util.List<org.osgi.resource.Capability> findCapabilities​(java.lang.String ns,
                                                                             java.lang.String filter)
                                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • from

        public java.util.Map<org.osgi.resource.Capability,​org.osgi.resource.Capability> from​(org.osgi.resource.Resource bundle)
                                                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getReporter

        public aQute.service.reporter.Reporter getReporter()
      • addContentCapability

        public void addContentCapability​(java.net.URI uri,
                                         java.lang.String sha256,
                                         long length,
                                         java.lang.String mime)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addFile

        public boolean addFile​(java.io.File file,
                               java.net.URI uri)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception