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

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

public class ImportedPackageImpl
extends Object
implements org.apache.aries.application.modelling.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
 boolean equals(Object thing)
           
 String getAttributeFilter()
           
 Map<String,String> getAttributes()
          Get this ImportedPackageImpl's attributes
 String getPackageName()
          Get the package name
 org.apache.aries.application.modelling.ResourceType getType()
           
 String getVersionRange()
          Get the imported package's version range
 int hashCode()
           
 boolean isMultiple()
           
 boolean isOptional()
           
 boolean isSatisfied(org.apache.aries.application.modelling.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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImportedPackageImpl

public ImportedPackageImpl(String pkg,
                           Map<String,String> attributes)
                    throws org.apache.aries.application.InvalidAttributeException
Construct a package requirement

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

getAttributes

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

Specified by:
getAttributes in interface org.apache.aries.application.modelling.ImportedPackage
Returns:
attributes

getPackageName

public String getPackageName()
Get the package name

Specified by:
getPackageName in interface org.apache.aries.application.modelling.ImportedPackage
Returns:
package name

getVersionRange

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

Specified by:
getVersionRange in interface org.apache.aries.application.modelling.ImportedPackage
Returns:
version range

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

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 org.apache.aries.application.modelling.DeploymentMFElement
Returns:
A String

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object thing)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


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