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 void
addAllExecutionEnvironments(EE ee)
void
addCapabilities(java.util.List<org.osgi.resource.Capability> capabilities)
ResourceBuilder
addCapability(CapReqBuilder builder)
ResourceBuilder
addCapability(org.osgi.resource.Capability capability)
org.osgi.resource.Capability
addCapability0(CapReqBuilder builder)
void
addContentCapability(java.net.URI uri, java.lang.String sha256, long length, java.lang.String mime)
void
addEE(EE ee)
void
addExecutionEnvironment(EE ee)
void
addExportPackage(java.lang.String packageName, Attrs attrs)
void
addExportPackages(Parameters exports)
Add Exported Packagesvoid
addExportServices(Parameters exportServices)
boolean
addFile(java.io.File file, java.net.URI uri)
void
addFragmentHost(java.lang.String bsn, Attrs attrs)
org.osgi.resource.Requirement
addImportPackage(java.lang.String pname, Attrs attrs)
void
addImportPackages(Parameters imports)
Add imported packagesvoid
addImportServices(Parameters importServices)
boolean
addManifest(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.Capability
addProvideCapability(java.lang.String namespace, Attrs attrs)
void
addRequireBundle(java.lang.String bsn, Attrs attrs)
void
addRequireBundle(java.lang.String bsn, VersionRange range)
void
addRequireBundles(Parameters requireBundle)
Add the Require-Bundle headervoid
addRequireCapabilities(Parameters required)
void
addRequireCapability(java.lang.String namespace, java.lang.String name, Attrs attrs)
ResourceBuilder
addRequirement(CapReqBuilder builder)
void
addRequirement(java.util.List<org.osgi.resource.Requirement> requirements)
ResourceBuilder
addRequirement(org.osgi.resource.Requirement requirement)
void
addRequirements(java.util.List<org.osgi.resource.Requirement> requires)
org.osgi.resource.Resource
build()
void
copyCapabilities(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()
RequirementBuilder
getNativeCode(java.lang.String header)
Caclulate the requirement from a native code headeraQute.service.reporter.Reporter
getReporter()
-
-
-
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
-
-