org.jboss.osgi.resolver.spi
Class AbstractBundleRequirement
java.lang.Object
org.jboss.osgi.resolver.spi.AbstractRequirement
org.jboss.osgi.resolver.spi.AbstractBundleRequirement
- All Implemented Interfaces:
- XAttachmentSupport, XAttributeSupport, XBundleRequirement, XDirectiveSupport, XElement, XRequirement, BundleRequirement, Requirement
public class AbstractBundleRequirement
- extends AbstractRequirement
- implements XBundleRequirement
The abstract implementation of an XBundleRequirement.
- Since:
- 30-May-2012
- Author:
- thomas.diesler@jboss.com
| Methods inherited from class org.jboss.osgi.resolver.spi.AbstractRequirement |
adapt, getAttribute, getAttributes, getDirective, getDirectives, getFilterFromDirective, getNamespace, isOptional, matches, namespaceValueFromFilter, toString, validate |
AbstractBundleRequirement
public AbstractBundleRequirement(XResource resource,
String namespace,
Map<String,Object> atts,
Map<String,String> dirs)
getResource
public BundleRevision getResource()
- Description copied from interface:
Requirement
- Returns the resource declaring this requirement.
- Specified by:
getResource in interface BundleRequirement- Specified by:
getResource in interface Requirement- Overrides:
getResource in class AbstractRequirement
- 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 interface BundleRequirement
- 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 interface BundleRequirement
- Parameters:
cap - The capability to match to this requirement.
- Returns:
true if the specified capability has the same
namespace as this requirement and the
filter for this requirement matches the
attributes of the
specified capability; false otherwise.
addAttachment
public <T> T addAttachment(Class<T> clazz,
T value)
- Description copied from interface:
XAttachmentSupport
- Attach an arbirtary object with this element.
- Specified by:
addAttachment in interface XAttachmentSupport
- Parameters:
clazz - key for the attachment
- Returns:
- The previously attachment object or null
getAttachment
public <T> T getAttachment(Class<T> clazz)
- Description copied from interface:
XAttachmentSupport
- Get the attached object for a given key
- Specified by:
getAttachment in interface XAttachmentSupport
- Parameters:
clazz - key for the attachment
- Returns:
- The attached object or null
removeAttachment
public <T> T removeAttachment(Class<T> clazz)
- Description copied from interface:
XAttachmentSupport
- Remove an attached object for a given key
- Specified by:
removeAttachment in interface XAttachmentSupport
- Parameters:
clazz - key for the attachment
- Returns:
- The attached object or null
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.