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

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

public class ImportedBundleImpl
extends Object
implements org.apache.aries.application.modelling.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
 org.apache.aries.application.modelling.ResourceType getType()
           
 String getVersionRange()
          Get the version range on this bundle import
 int hashCode()
           
 boolean isMultiple()
           
 boolean isOptional()
           
 boolean isSatisfied(org.apache.aries.application.modelling.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 org.apache.aries.application.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:
org.apache.aries.application.InvalidAttributeException

ImportedBundleImpl

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

Parameters:
bundleName - Bundle symbolic name
versionRange - Bundle version range
Throws:
org.apache.aries.application.InvalidAttributeException
Method Detail

getAttributeFilter

public String getAttributeFilter()
Specified by:
getAttributeFilter in interface org.apache.aries.application.modelling.Consumer

getType

public org.apache.aries.application.modelling.ResourceType getType()
Specified by:
getType in interface org.apache.aries.application.modelling.Consumer

isMultiple

public boolean isMultiple()
Specified by:
isMultiple in interface org.apache.aries.application.modelling.Consumer

isOptional

public boolean isOptional()
Specified by:
isOptional in interface org.apache.aries.application.modelling.Consumer

isSatisfied

public boolean isSatisfied(org.apache.aries.application.modelling.Provider capability)
Specified by:
isSatisfied in interface org.apache.aries.application.modelling.Consumer

getVersionRange

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

Specified by:
getVersionRange in interface org.apache.aries.application.modelling.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 org.apache.aries.application.modelling.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-2012 The Apache Software Foundation. All Rights Reserved.