org.jboss.osgi.resolver.spi
Class AbstractFragmentHostRequirement

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractRequirement
      extended by org.jboss.osgi.resolver.spi.AbstractFragmentHostRequirement
All Implemented Interfaces:
XAttachmentSupport, XAttributeSupport, XDirectiveSupport, XElement, XIdentityRequirement, XRequirement, org.osgi.framework.resource.Requirement

public class AbstractFragmentHostRequirement
extends AbstractRequirement
implements XIdentityRequirement

The abstract implementation of a XIdentityRequirement.

Since:
02-Jul-2010
Author:
thomas.diesler@jboss.com

Constructor Summary
protected AbstractFragmentHostRequirement(org.osgi.framework.resource.Resource resource, Map<String,Object> atts, Map<String,String> dirs)
           
 
Method Summary
<T> T
adapt(Class<T> clazz)
           
<T> T
addAttachment(Class<T> clazz, T value)
          Attach an arbirtary object with this element.
<T> T
getAttachment(Class<T> clazz)
          Get the attached object for a given key
protected  List<String> getMandatoryAttributes()
           
 String getSymbolicName()
           
 org.osgi.framework.VersionRange getVersionRange()
           
 boolean matches(org.osgi.framework.resource.Capability cap)
           
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 
Methods inherited from class org.jboss.osgi.resolver.spi.AbstractRequirement
getAttribute, getAttributes, getDirective, getDirectives, getNamespace, getResource, isOptional, toString, validateAttributes
 
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.XRequirement
isOptional
 
Methods inherited from interface org.jboss.osgi.resolver.XElement
adapt
 
Methods inherited from interface org.jboss.osgi.resolver.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 
Methods inherited from interface org.jboss.osgi.resolver.XAttributeSupport
getAttribute, getAttributes
 
Methods inherited from interface org.jboss.osgi.resolver.XDirectiveSupport
getDirective, getDirectives
 
Methods inherited from interface org.osgi.framework.resource.Requirement
getAttributes, getDirectives, getNamespace, getResource
 

Constructor Detail

AbstractFragmentHostRequirement

protected AbstractFragmentHostRequirement(org.osgi.framework.resource.Resource resource,
                                          Map<String,Object> atts,
                                          Map<String,String> dirs)
Method Detail

getMandatoryAttributes

protected List<String> getMandatoryAttributes()
Specified by:
getMandatoryAttributes in class AbstractRequirement

getSymbolicName

public String getSymbolicName()
Specified by:
getSymbolicName in interface XIdentityRequirement

getVersionRange

public org.osgi.framework.VersionRange getVersionRange()
Specified by:
getVersionRange in interface XIdentityRequirement

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.