org.jboss.classloading.plugins.metadata
Class PackageCapability

java.lang.Object
  extended by org.jboss.classloading.spi.helpers.NameAndVersionSupport
      extended by org.jboss.classloading.spi.metadata.helpers.AbstractCapability
          extended by org.jboss.classloading.plugins.metadata.PackageCapability
All Implemented Interfaces:
Serializable, Cloneable, Capability, ExportPackages

public class PackageCapability
extends AbstractCapability
implements ExportPackages

PackageCapability.

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Constructor Summary
PackageCapability()
          Create a new PackageCapability.
PackageCapability(String name)
          Create a new PackageCapability with the default version
PackageCapability(String name, Object version)
          Create a new PackageCapability.
 
Method Summary
 boolean equals(Object obj)
           
 Set<String> getPackageNames(Module module)
          Get the package names
 boolean resolves(Module module, Requirement requirement)
          Whether this capability resolves the requirement
 
Methods inherited from class org.jboss.classloading.spi.metadata.helpers.AbstractCapability
toString, toString
 
Methods inherited from class org.jboss.classloading.spi.helpers.NameAndVersionSupport
clone, getName, getTheVersion, getVersion, hashCode, setName, setTheVersion, setVersion
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PackageCapability

public PackageCapability()
Create a new PackageCapability.


PackageCapability

public PackageCapability(String name)
Create a new PackageCapability with the default version

Parameters:
name - the name
Throws:
IllegalArgumentException - for a null name

PackageCapability

public PackageCapability(String name,
                         Object version)
Create a new PackageCapability.

Parameters:
name - the name
version - the version - pass null for default version
Throws:
IllegalArgumentException - for a null name
Method Detail

resolves

public boolean resolves(Module module,
                        Requirement requirement)
Description copied from interface: Capability
Whether this capability resolves the requirement

Specified by:
resolves in interface Capability
Parameters:
module - the module
requirement - the requirement
Returns:
true when it is resolves the requirement

getPackageNames

public Set<String> getPackageNames(Module module)
Description copied from interface: ExportPackages
Get the package names

Specified by:
getPackageNames in interface ExportPackages
Parameters:
module - the module
Returns:
the package names

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractCapability


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.