org.apache.avalon.excalibur.extension
Class Extension

java.lang.Object
  |
  +--org.apache.avalon.excalibur.extension.Extension

public final class Extension
extends java.lang.Object

Utility class that represents either an available "Optional Package" (formerly known as "Standard Extension") as described in the manifest of a JAR file, or the requirement for such an optional package.

For more information about optional packages, see the document Optional Package Versioning in the documentation bundle for your Java2 Standard Edition package, in file guide/extensions/versioning.html.

Version:
$Revision: 1.8 $ $Date: 2001/12/11 09:53:34 $
Author:
Craig R. McClanahan, Peter Donald

Inner Class Summary
static class Extension.Compatability
           
 
Field Summary
static Extension.Compatability COMPATIBLE
           
static Extension.Compatability INCOMPATIBLE
           
static Extension.Compatability REQUIRE_IMPLEMENTATION_UPGRADE
           
static Extension.Compatability REQUIRE_SPECIFICATION_UPGRADE
           
static Extension.Compatability REQUIRE_VENDOR_SWITCH
           
 
Constructor Summary
Extension(java.lang.String extensionName, java.lang.String specificationVersion, java.lang.String specificationVendor, java.lang.String implementationVersion, java.lang.String implementationVendor, java.lang.String implementationVendorId, java.lang.String implementationURL)
          The constructor to create Extension object.
 
Method Summary
static Extension[] getAvailable(java.util.jar.Manifest manifest)
          Return an array of Extension objects representing optional packages that are available in the JAR file associated with the specified Manifest.
 Extension.Compatability getCompatibilityWith(Extension required)
          Return a Compatibility enum indicating the relationship of this Extension with the specified Extension.
 java.lang.String getExtensionName()
           
 java.lang.String getImplementationURL()
           
 java.lang.String getImplementationVendor()
           
 java.lang.String getImplementationVendorId()
           
 DeweyDecimal getImplementationVersion()
           
static Extension[] getRequired(java.util.jar.Manifest manifest)
          Return the set of Extension objects representing optional packages that are required by the application contained in the JAR file associated with the specified Manifest.
 java.lang.String getSpecificationVendor()
           
 DeweyDecimal getSpecificationVersion()
           
 boolean isCompatibleWith(Extension required)
          Return true if the specified Extension (which represents an optional package required by an application) is satisfied by this Extension (which represents an optional package that is already installed.
 java.lang.String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPATIBLE

public static final Extension.Compatability COMPATIBLE

REQUIRE_SPECIFICATION_UPGRADE

public static final Extension.Compatability REQUIRE_SPECIFICATION_UPGRADE

REQUIRE_VENDOR_SWITCH

public static final Extension.Compatability REQUIRE_VENDOR_SWITCH

REQUIRE_IMPLEMENTATION_UPGRADE

public static final Extension.Compatability REQUIRE_IMPLEMENTATION_UPGRADE

INCOMPATIBLE

public static final Extension.Compatability INCOMPATIBLE
Constructor Detail

Extension

public Extension(java.lang.String extensionName,
                 java.lang.String specificationVersion,
                 java.lang.String specificationVendor,
                 java.lang.String implementationVersion,
                 java.lang.String implementationVendor,
                 java.lang.String implementationVendorId,
                 java.lang.String implementationURL)
The constructor to create Extension object. Note that every component is allowed to be specified but only the extensionName is mandatory.
Parameters:
extensionName - the name of extension.
specificationVersion - the specification Version of extension.
specificationVendor - the specification Vendor of extension.
implementationVersion - the implementation Version of extension.
implementationVendor - the implementation Vendor of extension.
implementationVendorId - the implementation VendorId of extension.
implementationURL - the implementation URL of extension.
Method Detail

getAvailable

public static Extension[] getAvailable(java.util.jar.Manifest manifest)
Return an array of Extension objects representing optional packages that are available in the JAR file associated with the specified Manifest. If there are no such optional packages, a zero-length array is returned.
Parameters:
manifest - Manifest to be parsed

getRequired

public static Extension[] getRequired(java.util.jar.Manifest manifest)
Return the set of Extension objects representing optional packages that are required by the application contained in the JAR file associated with the specified Manifest. If there are no such optional packages, a zero-length list is returned.
Parameters:
manifest - Manifest to be parsed

getExtensionName

public java.lang.String getExtensionName()

getSpecificationVendor

public java.lang.String getSpecificationVendor()

getSpecificationVersion

public DeweyDecimal getSpecificationVersion()

getImplementationURL

public java.lang.String getImplementationURL()

getImplementationVendor

public java.lang.String getImplementationVendor()

getImplementationVendorId

public java.lang.String getImplementationVendorId()

getImplementationVersion

public DeweyDecimal getImplementationVersion()

getCompatibilityWith

public Extension.Compatability getCompatibilityWith(Extension required)
Return a Compatibility enum indicating the relationship of this Extension with the specified Extension.
Parameters:
required - Description of the required optional package

isCompatibleWith

public boolean isCompatibleWith(Extension required)
Return true if the specified Extension (which represents an optional package required by an application) is satisfied by this Extension (which represents an optional package that is already installed. Otherwise, return false.
Parameters:
required - Description of the required optional package

toString

public java.lang.String toString()
Return a String representation of this object.
Overrides:
toString in class java.lang.Object


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.