org.apache.aries.application.modelling.impl
Class ImportedBundleImpl

java.lang.Object
  extended by org.apache.aries.application.modelling.impl.ImportedBundleImpl
All Implemented Interfaces:
Consumer, ImportedBundle

public class ImportedBundleImpl
extends Object
implements ImportedBundle

A model of a Bundle imported, or required, by something. For example, an entry in an APPLICATION.MF.


Constructor Summary
ImportedBundleImpl(String filterString, Map<String,String> attributes)
          Build an ImportedBundleImpl from filter string and a set of attributes.
ImportedBundleImpl(String bundleName, String versionRange)
          Build an ImportedBundleImpl from a bundle name and version range.
 
Method Summary
 boolean equals(Object o)
          Equal if symbolic names match and version strings match
 String getAttributeFilter()
           
 String getSymbolicName()
          Get the symbolic name of the imported bundle
 ResourceType getType()
           
 String getVersionRange()
          Get the version range on this bundle import
 int hashCode()
           
 boolean isMultiple()
           
 boolean isOptional()
           
 boolean isSatisfied(Provider capability)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImportedBundleImpl

public ImportedBundleImpl(String filterString,
                          Map<String,String> attributes)
                   throws InvalidAttributeException
Build an ImportedBundleImpl from filter string and a set of attributes. The filter string is most easily obtained ManifestHeaderProcessor.generateFilter() or Requirement.getFilter() - be careful if building your own.

Parameters:
filterString - For example as obtained from Requirement.getFilter()
attributes -
Throws:
InvalidAttributeException

ImportedBundleImpl

public ImportedBundleImpl(String bundleName,
                          String versionRange)
                   throws InvalidAttributeException
Build an ImportedBundleImpl from a bundle name and version range.

Parameters:
bundleName - Bundle symbolic name
versionRange - Bundle version range
Throws:
InvalidAttributeException
Method Detail

getAttributeFilter

public String getAttributeFilter()
Specified by:
getAttributeFilter in interface Consumer

getType

public ResourceType getType()
Specified by:
getType in interface Consumer

isMultiple

public boolean isMultiple()
Specified by:
isMultiple in interface Consumer

isOptional

public boolean isOptional()
Specified by:
isOptional in interface Consumer

isSatisfied

public boolean isSatisfied(Provider capability)
Specified by:
isSatisfied in interface Consumer

getVersionRange

public String getVersionRange()
Get the version range on this bundle import

Specified by:
getVersionRange in interface ImportedBundle
Returns:
Imported version range, as a string

getSymbolicName

public String getSymbolicName()
Get the symbolic name of the imported bundle

Specified by:
getSymbolicName in interface ImportedBundle
Returns:
symbolic name

equals

public boolean equals(Object o)
Equal if symbolic names match and version strings match

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.