org.jboss.osgi.resolver.spi
Class AbstractPackageRequirement
java.lang.Object
org.jboss.osgi.resolver.spi.AbstractRequirement
org.jboss.osgi.resolver.spi.AbstractPackageRequirement
- All Implemented Interfaces:
- XAttachmentSupport, XAttributeSupport, XDirectiveSupport, XElement, XPackageRequirement, XRequirement, org.osgi.framework.resource.Requirement
public class AbstractPackageRequirement
- extends AbstractRequirement
- implements XPackageRequirement
The abstract implementation of a XPackageRequirement.
- Since:
- 02-Jul-2010
- Author:
- thomas.diesler@jboss.com
| Methods inherited from interface org.jboss.osgi.resolver.XElement |
adapt |
| Methods inherited from interface org.osgi.framework.resource.Requirement |
getAttributes, getDirectives, getNamespace, getResource |
AbstractPackageRequirement
protected AbstractPackageRequirement(org.osgi.framework.resource.Resource resource,
Map<String,Object> attributes,
Map<String,String> directives)
getMandatoryAttributes
protected List<String> getMandatoryAttributes()
- Specified by:
getMandatoryAttributes in class AbstractRequirement
getPackageName
public String getPackageName()
- Specified by:
getPackageName in interface XPackageRequirement
getVersionRange
public org.osgi.framework.VersionRange getVersionRange()
- Specified by:
getVersionRange in interface XPackageRequirement
matches
public boolean matches(org.osgi.framework.resource.Capability cap)
- Specified by:
matches in interface org.osgi.framework.resource.Requirement- Overrides:
matches in class AbstractRequirement
adapt
public <T> T adapt(Class<T> clazz)
- Specified by:
adapt in interface XElement
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. All Rights Reserved.