Package aQute.bnd.osgi.resource
Class ResourceBuilder
- java.lang.Object
-
- aQute.bnd.osgi.resource.ResourceBuilder
-
public class ResourceBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ResourceBuilder()ResourceBuilder(org.osgi.resource.Resource source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllExecutionEnvironments(EE ee)voidaddCapabilities(java.util.List<org.osgi.resource.Capability> capabilities)ResourceBuilderaddCapability(CapReqBuilder builder)ResourceBuilderaddCapability(org.osgi.resource.Capability capability)org.osgi.resource.CapabilityaddCapability0(CapReqBuilder builder)voidaddContentCapability(java.net.URI uri, java.lang.String sha256, long length, java.lang.String mime)voidaddEE(EE ee)voidaddExecutionEnvironment(EE ee)voidaddExportPackage(java.lang.String packageName, Attrs attrs)voidaddExportPackages(Parameters exports)Add Exported PackagesvoidaddExportServices(Parameters exportServices)booleanaddFile(java.io.File file, java.net.URI uri)voidaddFragmentHost(java.lang.String bsn, Attrs attrs)org.osgi.resource.RequirementaddImportPackage(java.lang.String pname, Attrs attrs)voidaddImportPackages(Parameters imports)Add imported packagesvoidaddImportServices(Parameters importServices)booleanaddManifest(Domain manifest)Parse the manifest and turn them into requirements & capabilitiesjava.util.List<org.osgi.resource.Capability>addProvideCapabilities(Parameters capabilities)java.util.List<org.osgi.resource.Capability>addProvideCapabilities(java.lang.String clauses)org.osgi.resource.CapabilityaddProvideCapability(java.lang.String namespace, Attrs attrs)voidaddRequireBundle(java.lang.String bsn, Attrs attrs)voidaddRequireBundle(java.lang.String bsn, VersionRange range)voidaddRequireBundles(Parameters requireBundle)Add the Require-Bundle headervoidaddRequireCapabilities(Parameters required)voidaddRequireCapability(java.lang.String namespace, java.lang.String name, Attrs attrs)ResourceBuilderaddRequirement(CapReqBuilder builder)voidaddRequirement(java.util.List<org.osgi.resource.Requirement> requirements)ResourceBuilderaddRequirement(org.osgi.resource.Requirement requirement)voidaddRequirements(java.util.List<org.osgi.resource.Requirement> requires)org.osgi.resource.Resourcebuild()voidcopyCapabilities(java.util.Set<java.lang.String> ignoreNamespaces, org.osgi.resource.Resource r)java.util.List<org.osgi.resource.Capability>findCapabilities(java.lang.String ns, java.lang.String filter)java.util.Map<org.osgi.resource.Capability,org.osgi.resource.Capability>from(org.osgi.resource.Resource bundle)java.util.List<org.osgi.resource.Capability>getCapabilities()RequirementBuildergetNativeCode(java.lang.String header)Caclulate the requirement from a native code headeraQute.service.reporter.ReportergetReporter()
-
-
-
Method Detail
-
addCapability
public ResourceBuilder addCapability(org.osgi.resource.Capability capability) throws java.lang.Exception
- Throws:
java.lang.Exception
-
addCapability
public ResourceBuilder addCapability(CapReqBuilder builder)
-
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
-
addRequirement
public ResourceBuilder addRequirement(CapReqBuilder builder)
-
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
-
-