Class BundleRequirementImpl
- java.lang.Object
-
- org.apache.felix.framework.wiring.BundleRequirementImpl
-
- All Implemented Interfaces:
BundleRequirement
,Requirement
- Direct Known Subclasses:
WrappedRequirement
public class BundleRequirementImpl extends java.lang.Object implements BundleRequirement
-
-
Constructor Summary
Constructors Constructor Description BundleRequirementImpl(BundleRevision revision, java.lang.String namespace, java.util.Map<java.lang.String,java.lang.String> dirs, java.util.Map<java.lang.String,java.lang.Object> attrs)
BundleRequirementImpl(BundleRevision revision, java.lang.String namespace, java.util.Map<java.lang.String,java.lang.String> dirs, java.util.Map<java.lang.String,java.lang.Object> attrs, SimpleFilter filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
Returns the attributes of this requirement.java.util.Map<java.lang.String,java.lang.String>
getDirectives()
Returns the directives of this requirement.SimpleFilter
getFilter()
java.lang.String
getNamespace()
Returns the namespace of this requirement.BundleRevision
getResource()
Returns the resource declaring this requirement.BundleRevision
getRevision()
Returns the bundle revision declaring this requirement.boolean
isOptional()
boolean
matches(BundleCapability cap)
Returns whether the specified capability matches this requirement.java.lang.String
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 Detail
-
BundleRequirementImpl
public BundleRequirementImpl(BundleRevision revision, java.lang.String namespace, java.util.Map<java.lang.String,java.lang.String> dirs, java.util.Map<java.lang.String,java.lang.Object> attrs, SimpleFilter filter)
-
BundleRequirementImpl
public BundleRequirementImpl(BundleRevision revision, java.lang.String namespace, java.util.Map<java.lang.String,java.lang.String> dirs, java.util.Map<java.lang.String,java.lang.Object> attrs)
-
-
Method Detail
-
getNamespace
public java.lang.String 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
public java.util.Map<java.lang.String,java.lang.String> 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
public java.util.Map<java.lang.String,java.lang.Object> 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
public BundleRevision 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
public BundleRevision 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
public boolean matches(BundleCapability cap)
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
public SimpleFilter getFilter()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-