Class BundleRequirementImpl
java.lang.Object
org.apache.felix.framework.wiring.BundleRequirementImpl
- All Implemented Interfaces:
BundleRequirement
,Requirement
- Direct Known Subclasses:
WrappedRequirement
-
Constructor Summary
ConstructorsConstructorDescriptionBundleRequirementImpl
(BundleRevision revision, String namespace, Map<String, String> dirs, Map<String, Object> attrs) BundleRequirementImpl
(BundleRevision revision, String namespace, Map<String, String> dirs, Map<String, Object> attrs, SimpleFilter filter) -
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes of this requirement.Returns the directives of this requirement.Returns the namespace of this requirement.Returns the resource declaring this requirement.Returns the bundle revision declaring this requirement.boolean
boolean
matches
(BundleCapability cap) Returns whether the specified capability matches this requirement.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.osgi.resource.Requirement
equals, hashCode
-
Constructor Details
-
BundleRequirementImpl
public BundleRequirementImpl(BundleRevision revision, String namespace, Map<String, String> dirs, Map<String, Object> attrs, SimpleFilter filter) -
BundleRequirementImpl
-
-
Method Details
-
getNamespace
Description copied from interface:BundleRequirement
Returns the namespace of this requirement.- Specified by:
getNamespace
in interfaceBundleRequirement
- Specified by:
getNamespace
in interfaceRequirement
- Returns:
- The namespace of this requirement.
-
getDirectives
Description copied from interface:BundleRequirement
Returns the directives of this requirement.All requirement directives not specified by the
wiring namespaces
have no specified semantics and are considered extra user defined information.- Specified by:
getDirectives
in interfaceBundleRequirement
- Specified by:
getDirectives
in interfaceRequirement
- Returns:
- An unmodifiable map of directive names to directive values for this requirement, or an empty map if this requirement has no directives.
-
getAttributes
Description copied from interface:BundleRequirement
Returns the attributes of this requirement.Requirement attributes have no specified semantics and are considered extra user defined information.
- Specified by:
getAttributes
in interfaceBundleRequirement
- Specified by:
getAttributes
in interfaceRequirement
- Returns:
- An unmodifiable map of attribute names to attribute values for this requirement, or an empty map if this requirement has no attributes.
-
getResource
Description copied from interface:BundleRequirement
Returns the resource declaring this requirement.This method returns the same value as
BundleRequirement.getRevision()
.- Specified by:
getResource
in interfaceBundleRequirement
- Specified by:
getResource
in interfaceRequirement
- Returns:
- The resource declaring this requirement. This can be
null
if this requirement is synthesized.
-
getRevision
Description copied from interface:BundleRequirement
Returns the bundle revision declaring this requirement.- Specified by:
getRevision
in interfaceBundleRequirement
- Returns:
- The bundle revision declaring this requirement.
-
matches
Description copied from interface:BundleRequirement
Returns whether the specified capability matches this requirement.- Specified by:
matches
in interfaceBundleRequirement
- Parameters:
cap
- The capability to match to this requirement.- Returns:
true
if the specified capability has the samenamespace
as this requirement and the filter for this requirement matches theattributes of the specified capability
;false
otherwise.
-
isOptional
public boolean isOptional() -
getFilter
-
toString
-