Class CapabilityImpl
java.lang.Object
org.apache.felix.utils.resource.CapabilityImpl
- All Implemented Interfaces:
org.osgi.resource.Capability
Implementation of the OSGi Capability interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionOptional attributes.Optional attributes.protected final StringThe namespace.protected final org.osgi.resource.ResourceThe resource. -
Constructor Summary
ConstructorsConstructorDescriptionCapabilityImpl(org.osgi.resource.Resource res, String ns, Map<String, String> dirs, Map<String, Object> attrs) Create a capability.CapabilityImpl(org.osgi.resource.Resource resource, org.osgi.resource.Capability capability) Create a capability based on an existing capability, providing the resource. -
Method Summary
Modifier and TypeMethodDescriptionReturn the attributes.Return the directives.Return the namespace.org.osgi.resource.ResourceReturn the resource.booleanisAttributeMandatory(String name) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.osgi.resource.Capability
equals, getAttributes, getDirectives, getNamespace, getResource, hashCode
-
Field Details
-
mandatory
-
resource
protected final org.osgi.resource.Resource resourceThe resource. Required. -
namespace
The namespace. Required. -
directives
-
attributes
-
-
Constructor Details
-
CapabilityImpl
public CapabilityImpl(org.osgi.resource.Resource res, String ns, Map<String, String> dirs, Map<String, Object> attrs) Create a capability.- Parameters:
res- The resource associated with the capability.ns- The namespace of the capability.dirs- The directives of the capability.attrs- The attributes of the capability.
-
CapabilityImpl
public CapabilityImpl(org.osgi.resource.Resource resource, org.osgi.resource.Capability capability) Create a capability based on an existing capability, providing the resource. The namespace, attributes and directives are copied from the provided capability.- Parameters:
resource- The resource to be associated with the capabilitycapability- The capability to base the new requirement on.
-
-
Method Details
-
isAttributeMandatory
-
getNamespace
Return the namespace.- Returns:
- The namespace. This is never @{code null}.
-
getAttributes
-
getDirectives
-
getResource
public org.osgi.resource.Resource getResource()Return the resource.- Returns:
- The resource or @{code null}.
-
toString
-