Class Extension
- java.lang.Object
- 
- org.apache.tools.ant.taskdefs.optional.extension.Extension
 
- 
 public final class Extension extends java.lang.ObjectUtility 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 SummaryFields Modifier and Type Field Description static CompatibilityCOMPATIBLEEnum indicating that extension is compatible with other extension.static java.util.jar.Attributes.NameEXTENSION_LISTManifest Attribute Name object for EXTENSION_LIST.static java.util.jar.Attributes.NameEXTENSION_NAMEManifest Attribute Name object for EXTENSION_NAME.static java.util.jar.Attributes.NameIMPLEMENTATION_URLManifest Attribute Name object for IMPLEMENTATION_URL.static java.util.jar.Attributes.NameIMPLEMENTATION_VENDORManifest Attribute Name object for IMPLEMENTATION_VENDOR.static java.util.jar.Attributes.NameIMPLEMENTATION_VENDOR_IDManifest Attribute Name object for IMPLEMENTATION_VENDOR_ID.static java.util.jar.Attributes.NameIMPLEMENTATION_VERSIONManifest Attribute Name object for IMPLEMENTATION_VERSION.static CompatibilityINCOMPATIBLEEnum indicating that extension is incompatible with other extension in ways other than other enums indicate).static java.util.jar.Attributes.NameOPTIONAL_EXTENSION_LISTNameobject forOptional-Extension-Listmanifest attribute used for declaring optional dependencies on installed extensions.static CompatibilityREQUIRE_IMPLEMENTATION_UPGRADEEnum indicating that extension requires an upgrade of implementation to be compatible with other extension.static CompatibilityREQUIRE_SPECIFICATION_UPGRADEEnum indicating that extension requires an upgrade of specification to be compatible with other extension.static CompatibilityREQUIRE_VENDOR_SWITCHEnum indicating that extension requires a vendor switch to be compatible with other extension.static java.util.jar.Attributes.NameSPECIFICATION_VENDORManifest Attribute Name object for SPECIFICATION_VENDOR.static java.util.jar.Attributes.NameSPECIFICATION_VERSIONManifest Attribute Name object for SPECIFICATION_VERSION.
 - 
Constructor SummaryConstructors Constructor Description 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 SummaryModifier and Type Method Description static voidaddExtension(Extension extension, java.lang.String prefix, java.util.jar.Attributes attributes)Add Extension to the specified manifest Attributes.static voidaddExtension(Extension extension, java.util.jar.Attributes attributes)Add Extension to the specified manifest Attributes.static Extension[]getAvailable(java.util.jar.Manifest manifest)Return an array ofExtensionobjects representing optional packages that are available in the JAR file associated with the specifiedManifest.CompatibilitygetCompatibilityWith(Extension required)Return a Compatibility enum indicating the relationship of thisExtensionwith the specifiedExtension.java.lang.StringgetExtensionName()Get the name of the extension.java.lang.StringgetImplementationURL()Get the url of the extensions implementation.java.lang.StringgetImplementationVendor()Get the vendor of the extensions implementation.java.lang.StringgetImplementationVendorID()Get the vendorID of the extensions implementation.DeweyDecimalgetImplementationVersion()Get the version of the extensions implementation.static Extension[]getOptions(java.util.jar.Manifest manifest)Return the set ofExtensionobjects representing "Optional Packages" that the application declares they will use if present.static Extension[]getRequired(java.util.jar.Manifest manifest)Return the set ofExtensionobjects representing optional packages that are required by the application contained in the JAR file associated with the specifiedManifest.java.lang.StringgetSpecificationVendor()Get the vendor of the extensions specification.DeweyDecimalgetSpecificationVersion()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.java.lang.StringtoString()Return a String representation of this object.
 
- 
- 
- 
Field Detail- 
EXTENSION_LISTpublic static final java.util.jar.Attributes.Name EXTENSION_LIST Manifest Attribute Name object for EXTENSION_LIST.
 - 
OPTIONAL_EXTENSION_LISTpublic static final java.util.jar.Attributes.Name OPTIONAL_EXTENSION_LIST Nameobject 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:
- Installed extension dependency
 
 - 
EXTENSION_NAMEpublic static final java.util.jar.Attributes.Name EXTENSION_NAME Manifest Attribute Name object for EXTENSION_NAME.
 - 
SPECIFICATION_VERSIONpublic static final java.util.jar.Attributes.Name SPECIFICATION_VERSION Manifest Attribute Name object for SPECIFICATION_VERSION.
 - 
SPECIFICATION_VENDORpublic static final java.util.jar.Attributes.Name SPECIFICATION_VENDOR Manifest Attribute Name object for SPECIFICATION_VENDOR.
 - 
IMPLEMENTATION_VERSIONpublic static final java.util.jar.Attributes.Name IMPLEMENTATION_VERSION Manifest Attribute Name object for IMPLEMENTATION_VERSION.
 - 
IMPLEMENTATION_VENDORpublic static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR Manifest Attribute Name object for IMPLEMENTATION_VENDOR.
 - 
IMPLEMENTATION_URLpublic static final java.util.jar.Attributes.Name IMPLEMENTATION_URL Manifest Attribute Name object for IMPLEMENTATION_URL.
 - 
IMPLEMENTATION_VENDOR_IDpublic static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR_ID Manifest Attribute Name object for IMPLEMENTATION_VENDOR_ID.
 - 
COMPATIBLEpublic static final Compatibility COMPATIBLE Enum indicating that extension is compatible with other extension.
 - 
REQUIRE_SPECIFICATION_UPGRADEpublic static final Compatibility REQUIRE_SPECIFICATION_UPGRADE Enum indicating that extension requires an upgrade of specification to be compatible with other extension.
 - 
REQUIRE_VENDOR_SWITCHpublic static final Compatibility REQUIRE_VENDOR_SWITCH Enum indicating that extension requires a vendor switch to be compatible with other extension.
 - 
REQUIRE_IMPLEMENTATION_UPGRADEpublic static final Compatibility REQUIRE_IMPLEMENTATION_UPGRADE Enum indicating that extension requires an upgrade of implementation to be compatible with other extension.
 - 
INCOMPATIBLEpublic static final Compatibility INCOMPATIBLE Enum 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 Detail- 
Extensionpublic 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- 
getAvailablepublic static Extension[] getAvailable(java.util.jar.Manifest manifest) Return 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
 
 - 
getRequiredpublic static Extension[] getRequired(java.util.jar.Manifest manifest) Return 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
 
 - 
getOptionspublic static Extension[] getOptions(java.util.jar.Manifest manifest) Return 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
 
 - 
addExtensionpublic static void addExtension(Extension extension, java.util.jar.Attributes attributes) Add Extension to the specified manifest Attributes.- Parameters:
- attributes- the attributes of manifest to add to
- extension- the extension
 
 - 
addExtensionpublic static void addExtension(Extension extension, java.lang.String prefix, java.util.jar.Attributes attributes) Add Extension to the specified manifest Attributes. Use the specified prefix so that dependencies can added with a prefix such as "java3d-" etc.- Parameters:
- attributes- the attributes of manifest to add to
- extension- the extension
- prefix- the name to prefix to extension
 
 - 
getExtensionNamepublic java.lang.String getExtensionName() Get the name of the extension.- Returns:
- the name of the extension
 
 - 
getSpecificationVendorpublic java.lang.String getSpecificationVendor() Get the vendor of the extensions specification.- Returns:
- the vendor of the extensions specification.
 
 - 
getSpecificationVersionpublic DeweyDecimal getSpecificationVersion() Get the version of the extensions specification.- Returns:
- the version of the extensions specification.
 
 - 
getImplementationURLpublic java.lang.String getImplementationURL() Get the url of the extensions implementation.- Returns:
- the url of the extensions implementation.
 
 - 
getImplementationVendorpublic java.lang.String getImplementationVendor() Get the vendor of the extensions implementation.- Returns:
- the vendor of the extensions implementation.
 
 - 
getImplementationVendorIDpublic java.lang.String getImplementationVendorID() Get the vendorID of the extensions implementation.- Returns:
- the vendorID of the extensions implementation.
 
 - 
getImplementationVersionpublic DeweyDecimal getImplementationVersion() Get the version of the extensions implementation.- Returns:
- the version of the extensions implementation.
 
 - 
getCompatibilityWithpublic Compatibility getCompatibilityWith(Extension required) Return 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
 
 - 
isCompatibleWithpublic boolean isCompatibleWith(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. Otherwise, returnfalse.- Parameters:
- required- Description of the required optional package
- Returns:
- true if the specified extension is compatible with this extension
 
 - 
toStringpublic java.lang.String toString() Return a String representation of this object.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- string representation of object.
 
 
- 
 
-