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
|
org.osgi.framework.Filter |
getFilter()
Get the filter associated with this requirement.
|
static org.osgi.framework.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(org.osgi.framework.Filter filter,
String attrname,
StringBuffer operator) |
org.osgi.framework.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, removeAttachmentclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAttachment, putAttachment, removeAttachmentpublic org.osgi.framework.Filter getFilter()
XRequirementgetFilter in interface XRequirementpublic XResource getResource()
XRequirementgetResource in interface XRequirementgetResource in interface org.osgi.resource.Requirementpublic void validate()
XRequirementvalidate in interface XRequirementpublic static org.osgi.framework.Filter getFilterFromDirective(org.osgi.resource.Requirement req)
public static String getValueFromFilter(org.osgi.framework.Filter filter, String attrname, StringBuffer operator)
public String getNamespace()
getNamespace in interface org.osgi.resource.Requirementpublic boolean isOptional()
XRequirementisOptional in interface XRequirementpublic Map<String,String> getDirectives()
XDirectiveSupportgetDirectives in interface XDirectiveSupportgetDirectives in interface org.osgi.resource.Requirementpublic String getDirective(String key)
XDirectiveSupportgetDirective in interface XDirectiveSupportpublic Map<String,Object> getAttributes()
XAttributeSupportgetAttributes in interface XAttributeSupportgetAttributes in interface org.osgi.resource.Requirementpublic Object getAttribute(String key)
XAttributeSupportgetAttribute in interface XAttributeSupportpublic <T extends XRequirement> T adapt(Class<T> clazz)
XRequirementadapt in interface XRequirementpublic boolean matches(org.osgi.resource.Capability cap)
XRequirementmatches in interface XRequirementpublic String getVisibility()
XIdentityRequirementgetVisibility in interface XIdentityRequirementBundleNamespace#REQUIREMENT_VISIBILITY_DIRECTIVE}public String getSymbolicName()
XHostRequirementgetSymbolicName in interface XHostRequirementgetSymbolicName in interface XIdentityRequirementpublic String getPackageName()
XPackageRequirementgetPackageName in interface XPackageRequirementpublic org.osgi.framework.VersionRange getVersionRange()
XIdentityRequirementgetVersionRange in interface XIdentityRequirementpublic boolean isDynamic()
XPackageRequirementisDynamic in interface XPackageRequirementCopyright © 2016 JBoss by Red Hat. All rights reserved.