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

java.lang.Object
  extended by org.apache.aries.application.modelling.impl.ImportedPackageImpl
All Implemented Interfaces:
Consumer, DeploymentMFElement, ImportedPackage

public class ImportedPackageImpl
extends Object
implements ImportedPackage

An imported, or required package. Capable of generating an entry in DEPLOYMENT.MF's Import-Package header.


Constructor Summary
ImportedPackageImpl(String pkg, Map<String,String> attributes)
          Construct a package requirement
 
Method Summary
 String getAttributeFilter()
           
 Map<String,String> getAttributes()
          Get this ImportedPackageImpl's attributes
 String getPackageName()
          Get the package name
 ResourceType getType()
           
 String getVersionRange()
          Get the imported package's version range
 boolean isMultiple()
           
 boolean isOptional()
           
 boolean isSatisfied(Provider capability)
           
 String toDeploymentString()
          This method turns an ImportedPackageImpl into a string suitable for a Provision-Bundle style package import.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImportedPackageImpl

public ImportedPackageImpl(String pkg,
                           Map<String,String> attributes)
                    throws InvalidAttributeException
Construct a package requirement

Parameters:
pkg - The name of the required package
attributes - Other attributes - most commonly, version
Throws:
InvalidAttributeException
Method Detail

getAttributes

public Map<String,String> getAttributes()
Get this ImportedPackageImpl's attributes

Specified by:
getAttributes in interface ImportedPackage
Returns:
attributes

getPackageName

public String getPackageName()
Get the package name

Specified by:
getPackageName in interface ImportedPackage
Returns:
package name

getVersionRange

public String getVersionRange()
Get the imported package's version range

Specified by:
getVersionRange in interface ImportedPackage
Returns:
version range

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

toDeploymentString

public String toDeploymentString()
This method turns an ImportedPackageImpl into a string suitable for a Provision-Bundle style package import. It will not include ;bundle-symbolic-name=bundleName;bundle-version=version attribute pairs

Specified by:
toDeploymentString in interface DeploymentMFElement
Returns:
A String

toString

public String toString()
Overrides:
toString in class Object


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