org.jboss.osgi.resolver.spi
Class AbstractHostedCapability

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractElement
      extended by org.jboss.osgi.resolver.spi.AbstractHostedCapability
All Implemented Interfaces:
XAttachmentSupport, XAttributeSupport, XCapability, XDirectiveSupport, XElement, XPackageCapability, org.osgi.resource.Capability, HostedCapability

public class AbstractHostedCapability
extends AbstractElement
implements HostedCapability, XPackageCapability

The abstract implementation of a HostedCapability.

Since:
29-Jun-2012
Author:
thomas.diesler@jboss.com

Constructor Summary
AbstractHostedCapability(XResource resource, XCapability capability)
           
 
Method Summary
<T extends XCapability>
T
adapt(Class<T> clazz)
          Adapt this capability to another type
 Object getAttribute(String key)
          Get the value of the given attribute
 Map<String,Object> getAttributes()
          Get the attributes
 org.osgi.resource.Capability getDeclaredCapability()
          Return the Capability hosted by the Resource.
 String getDirective(String key)
          Get the value of the given directive
 Map<String,String> getDirectives()
          Get the directives
 String getNamespace()
           
 String getPackageName()
          The package name
 org.osgi.resource.Resource getResource()
          Return the Resource that hosts this Capability.
 org.osgi.framework.Version getVersion()
          The package version.
 boolean isMutable()
           
 String toString()
           
 void validate()
          Validate the capability
 
Methods inherited from class org.jboss.osgi.resolver.spi.AbstractElement
addAttachment, getAttachment, removeAttachment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.osgi.resolver.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 
Methods inherited from interface org.osgi.resource.Capability
equals, hashCode
 

Constructor Detail

AbstractHostedCapability

public AbstractHostedCapability(XResource resource,
                                XCapability capability)
Method Detail

getResource

public org.osgi.resource.Resource getResource()
Description copied from interface: HostedCapability
Return the Resource that hosts this Capability.

Specified by:
getResource in interface org.osgi.resource.Capability
Specified by:
getResource in interface HostedCapability
Returns:
The Resource that hosts this Capability.

isMutable

public boolean isMutable()

getDeclaredCapability

public org.osgi.resource.Capability getDeclaredCapability()
Description copied from interface: HostedCapability
Return the Capability hosted by the Resource.

Specified by:
getDeclaredCapability in interface HostedCapability
Returns:
The Capability hosted by the Resource.

getNamespace

public String getNamespace()
Specified by:
getNamespace in interface org.osgi.resource.Capability

getDirectives

public Map<String,String> getDirectives()
Description copied from interface: XDirectiveSupport
Get the directives

Specified by:
getDirectives in interface XDirectiveSupport
Specified by:
getDirectives in interface org.osgi.resource.Capability

getAttributes

public Map<String,Object> getAttributes()
Description copied from interface: XAttributeSupport
Get the attributes

Specified by:
getAttributes in interface XAttributeSupport
Specified by:
getAttributes in interface org.osgi.resource.Capability

getAttribute

public Object getAttribute(String key)
Description copied from interface: XAttributeSupport
Get the value of the given attribute

Specified by:
getAttribute in interface XAttributeSupport
Returns:
null if no such attribute is associated with this capability

getDirective

public String getDirective(String key)
Description copied from interface: XDirectiveSupport
Get the value of the given directive

Specified by:
getDirective in interface XDirectiveSupport
Returns:
null if no such directive is associated with this capability

validate

public void validate()
Description copied from interface: XCapability
Validate the capability

Specified by:
validate in interface XCapability

getPackageName

public String getPackageName()
Description copied from interface: XPackageCapability
The package name

Specified by:
getPackageName in interface XPackageCapability

getVersion

public org.osgi.framework.Version getVersion()
Description copied from interface: XPackageCapability
The package version.

Specified by:
getVersion in interface XPackageCapability

adapt

public <T extends XCapability> T adapt(Class<T> clazz)
Description copied from interface: XCapability
Adapt this capability to another type

Specified by:
adapt in interface XCapability

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 JBoss by Red Hat. All Rights Reserved.