Class Extension
java.lang.Object
org.apache.tools.ant.taskdefs.optional.extension.Extension
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.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final CompatibilityEnum indicating that extension is compatible with other extension.static final Attributes.NameManifest Attribute Name object for EXTENSION_LIST.static final Attributes.NameManifest Attribute Name object for EXTENSION_NAME.static final Attributes.NameManifest Attribute Name object for IMPLEMENTATION_URL.static final Attributes.NameManifest Attribute Name object for IMPLEMENTATION_VENDOR.static final Attributes.NameManifest Attribute Name object for IMPLEMENTATION_VENDOR_ID.static final Attributes.NameManifest Attribute Name object for IMPLEMENTATION_VERSION.static final CompatibilityEnum indicating that extension is incompatible with other extension in ways other than other enums indicate).static final Attributes.NameNameobject forOptional-Extension-Listmanifest attribute used for declaring optional dependencies on installed extensions.static final CompatibilityEnum indicating that extension requires an upgrade of implementation to be compatible with other extension.static final CompatibilityEnum indicating that extension requires an upgrade of specification to be compatible with other extension.static final CompatibilityEnum indicating that extension requires a vendor switch to be compatible with other extension.static final Attributes.NameManifest Attribute Name object for SPECIFICATION_VENDOR.static final Attributes.NameManifest Attribute Name object for SPECIFICATION_VERSION.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidaddExtension(Extension extension, String prefix, Attributes attributes) Add Extension to the specified manifest Attributes.static voidaddExtension(Extension extension, Attributes attributes) Add Extension to the specified manifest Attributes.static Extension[]getAvailable(Manifest manifest) Return an array ofExtensionobjects representing optional packages that are available in the JAR file associated with the specifiedManifest.getCompatibilityWith(Extension required) Return a Compatibility enum indicating the relationship of thisExtensionwith the specifiedExtension.Get the name of the extension.Get the url of the extensions implementation.Get the vendor of the extensions implementation.Get the vendorID of the extensions implementation.Get the version of the extensions implementation.static Extension[]getOptions(Manifest manifest) Return the set ofExtensionobjects representing "Optional Packages" that the application declares they will use if present.static Extension[]getRequired(Manifest manifest) Return the set ofExtensionobjects representing optional packages that are required by the application contained in the JAR file associated with the specifiedManifest.Get the vendor of the extensions specification.Get the version of the extensions specification.booleanisCompatibleWith(Extension required) Returntrueif the specifiedExtension(which represents an optional package required by an application) is satisfied by thisExtension(which represents an optional package that is already installed.toString()Return a String representation of this object.
- 
Field Details- 
EXTENSION_LISTManifest Attribute Name object for EXTENSION_LIST.
- 
OPTIONAL_EXTENSION_LISTNameobject forOptional-Extension-Listmanifest attribute used for declaring optional dependencies on installed extensions. Note that the dependencies declared by this method are not required for the library to operate but if present will be used. It is NOT part of the official "Optional Package" specification.- See Also:
 
- 
EXTENSION_NAMEManifest Attribute Name object for EXTENSION_NAME.
- 
SPECIFICATION_VERSIONManifest Attribute Name object for SPECIFICATION_VERSION.
- 
SPECIFICATION_VENDORManifest Attribute Name object for SPECIFICATION_VENDOR.
- 
IMPLEMENTATION_VERSIONManifest Attribute Name object for IMPLEMENTATION_VERSION.
- 
IMPLEMENTATION_VENDORManifest Attribute Name object for IMPLEMENTATION_VENDOR.
- 
IMPLEMENTATION_URLManifest Attribute Name object for IMPLEMENTATION_URL.
- 
IMPLEMENTATION_VENDOR_IDManifest Attribute Name object for IMPLEMENTATION_VENDOR_ID.
- 
COMPATIBLEEnum indicating that extension is compatible with other extension.
- 
REQUIRE_SPECIFICATION_UPGRADEEnum indicating that extension requires an upgrade of specification to be compatible with other extension.
- 
REQUIRE_VENDOR_SWITCHEnum indicating that extension requires a vendor switch to be compatible with other extension.
- 
REQUIRE_IMPLEMENTATION_UPGRADEEnum indicating that extension requires an upgrade of implementation to be compatible with other extension.
- 
INCOMPATIBLEEnum indicating that extension is incompatible with other extension in ways other than other enums indicate). For example the other extension may have a different ID.
 
- 
- 
Constructor Details- 
Extensionpublic Extension(String extensionName, String specificationVersion, String specificationVendor, String implementationVersion, String implementationVendor, String implementationVendorId, 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 Details- 
getAvailableReturn an array ofExtensionobjects representing optional packages that are available in the JAR file associated with the specifiedManifest. If there are no such optional packages, a zero-length array is returned.- Parameters:
- manifest- Manifest to be parsed
- Returns:
- the "available" extensions in specified manifest
 
- 
getRequiredReturn the set ofExtensionobjects representing optional packages that are required by the application contained in the JAR file associated with the specifiedManifest. If there are no such optional packages, a zero-length list is returned.- Parameters:
- manifest- Manifest to be parsed
- Returns:
- the dependencies that are specified in manifest
 
- 
getOptionsReturn the set ofExtensionobjects representing "Optional Packages" that the application declares they will use if present. If there are no such optional packages, a zero-length list is returned.- Parameters:
- manifest- Manifest to be parsed
- Returns:
- the optional dependencies that are specified in manifest
 
- 
addExtensionAdd Extension to the specified manifest Attributes.- Parameters:
- extension- the extension
- attributes- the attributes of manifest to add to
 
- 
addExtensionAdd Extension to the specified manifest Attributes. Use the specified prefix so that dependencies can added with a prefix such as "java3d-" etc.- Parameters:
- extension- the extension
- prefix- the name to prefix to extension
- attributes- the attributes of manifest to add to
 
- 
getExtensionNameGet the name of the extension.- Returns:
- the name of the extension
 
- 
getSpecificationVendorGet the vendor of the extensions specification.- Returns:
- the vendor of the extensions specification.
 
- 
getSpecificationVersionGet the version of the extensions specification.- Returns:
- the version of the extensions specification.
 
- 
getImplementationURLGet the url of the extensions implementation.- Returns:
- the url of the extensions implementation.
 
- 
getImplementationVendorGet the vendor of the extensions implementation.- Returns:
- the vendor of the extensions implementation.
 
- 
getImplementationVendorIDGet the vendorID of the extensions implementation.- Returns:
- the vendorID of the extensions implementation.
 
- 
getImplementationVersionGet the version of the extensions implementation.- Returns:
- the version of the extensions implementation.
 
- 
getCompatibilityWithReturn a Compatibility enum indicating the relationship of thisExtensionwith the specifiedExtension.- Parameters:
- required- Description of the required optional package
- Returns:
- the enum indicating the compatibility (or lack thereof) of specified extension
 
- 
isCompatibleWithReturntrueif the specifiedExtension(which represents an optional package required by an application) is satisfied by thisExtension(which represents an optional package that is already installed. Otherwise, returnfalse.- Parameters:
- required- Description of the required optional package
- Returns:
- true if the specified extension is compatible with this extension
 
- 
toStringReturn a String representation of this object.
 
-