public class AbstractRequirement extends AbstractElement implements XHostRequirement, XPackageRequirement, XIdentityRequirement, XCapabilityRequirement
XRequirement
.Constructor and Description |
---|
AbstractRequirement(XResource resource,
String namespace,
Map<String,Object> atts,
Map<String,String> dirs) |
Modifier and Type | Method and Description |
---|---|
<T extends XRequirement> |
adapt(Class<T> clazz)
Adapt this requirement to another type
|
Object |
getAttribute(String key)
Get the value of the given attribute
|
Map<String,Object> |
getAttributes()
Get the attributes
|
String |
getDirective(String key)
Get the value of the given directive
|
Map<String,String> |
getDirectives()
Get the directives
|
Filter |
getFilter()
Get the filter associated with this requirement.
|
static Filter |
getFilterFromDirective(org.osgi.resource.Requirement req) |
String |
getNamespace() |
String |
getPackageName()
The package name
|
XResource |
getResource()
Get the resource declaring this requirement.
|
String |
getSymbolicName()
The bundle symbolic name
|
static String |
getValueFromFilter(Filter filter,
String attrname,
StringBuffer operator) |
VersionRange |
getVersionRange()
The bundle version range
|
String |
getVisibility()
Get the value of the visibility directive
|
boolean |
isDynamic()
A flag indicating that this is a dynamic package requirement
|
boolean |
isOptional()
A flag indicating that this is an optional requirement.
|
boolean |
matches(org.osgi.resource.Capability cap)
Matches this requirement against the given capability.
|
String |
toString() |
void |
validate()
Validate the requirement
|
getAttachment, putAttachment, removeAttachment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAttachment, putAttachment, removeAttachment
public Filter getFilter()
XRequirement
getFilter
in interface XRequirement
public XResource getResource()
XRequirement
getResource
in interface XRequirement
getResource
in interface org.osgi.resource.Requirement
public void validate()
XRequirement
validate
in interface XRequirement
public static Filter getFilterFromDirective(org.osgi.resource.Requirement req)
public static String getValueFromFilter(Filter filter, String attrname, StringBuffer operator)
public String getNamespace()
getNamespace
in interface org.osgi.resource.Requirement
public boolean isOptional()
XRequirement
isOptional
in interface XRequirement
public Map<String,String> getDirectives()
XDirectiveSupport
getDirectives
in interface XDirectiveSupport
getDirectives
in interface org.osgi.resource.Requirement
public String getDirective(String key)
XDirectiveSupport
getDirective
in interface XDirectiveSupport
public Map<String,Object> getAttributes()
XAttributeSupport
getAttributes
in interface XAttributeSupport
getAttributes
in interface org.osgi.resource.Requirement
public Object getAttribute(String key)
XAttributeSupport
getAttribute
in interface XAttributeSupport
public <T extends XRequirement> T adapt(Class<T> clazz)
XRequirement
adapt
in interface XRequirement
public boolean matches(org.osgi.resource.Capability cap)
XRequirement
matches
in interface XRequirement
public String getVisibility()
XIdentityRequirement
getVisibility
in interface XIdentityRequirement
BundleNamespace#REQUIREMENT_VISIBILITY_DIRECTIVE}
public String getSymbolicName()
XHostRequirement
getSymbolicName
in interface XHostRequirement
getSymbolicName
in interface XIdentityRequirement
public String getPackageName()
XPackageRequirement
getPackageName
in interface XPackageRequirement
public VersionRange getVersionRange()
XIdentityRequirement
getVersionRange
in interface XIdentityRequirement
public boolean isDynamic()
XPackageRequirement
isDynamic
in interface XPackageRequirement
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.