Class Specification
java.lang.Object
org.apache.tools.ant.taskdefs.optional.extension.Specification
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 Package Specification.static final Attributes.NameManifest Attribute Name object for IMPLEMENTATION_TITLE.static final Attributes.NameManifest Attribute Name object for IMPLEMENTATION_VENDOR.static final Attributes.NameManifest Attribute Name object for IMPLEMENTATION_VERSION.static final CompatibilityThis enum indicates that an extension is incompatible with other Package Specification in ways other than other enums indicate.static final CompatibilityEnum indicating that extension requires an upgrade of implementation to be compatible with other Package Specification.static final CompatibilityEnum indicating that extension requires an upgrade of specification to be compatible with other Package Specification.static final CompatibilityEnum indicating that extension requires a vendor switch to be compatible with other Package Specification.static final Attributes.NameManifest Attribute Name object for SPECIFICATION_TITLE.static final Attributes.NameManifest Attribute Name object for SPECIFICATION_VENDOR.static final Attributes.NameManifest Attribute Name object for SPECIFICATION_VERSION.
- 
Constructor SummaryConstructorsConstructorDescriptionSpecification(String specificationTitle, String specificationVersion, String specificationVendor, String implementationTitle, String implementationVersion, String implementationVendor) The constructor to create Package Specification object.Specification(String specificationTitle, String specificationVersion, String specificationVendor, String implementationTitle, String implementationVersion, String implementationVendor, String[] sections) The constructor to create Package Specification object.
- 
Method SummaryModifier and TypeMethodDescriptionReturn a Compatibility enum indicating the relationship of thisPackage Specificationwith the specifiedExtension.Get the title of the specification.Get the vendor of the extensions implementation.Get the version of the implementation.String[]Return an array containing sections to which specification applies or null if relevant to no sections.static Specification[]getSpecifications(Manifest manifest) Return an array ofPackage Specificationobjects.Get the title of the specification.Get the vendor of the specification.Get the version of the specification.booleanisCompatibleWith(Specification other) Returntrueif the specifiedpackageis satisfied by thisSpecification.toString()Return a String representation of this object.
- 
Field Details- 
SPECIFICATION_TITLEManifest Attribute Name object for SPECIFICATION_TITLE.
- 
SPECIFICATION_VERSIONManifest Attribute Name object for SPECIFICATION_VERSION.
- 
SPECIFICATION_VENDORManifest Attribute Name object for SPECIFICATION_VENDOR.
- 
IMPLEMENTATION_TITLEManifest Attribute Name object for IMPLEMENTATION_TITLE.
- 
IMPLEMENTATION_VERSIONManifest Attribute Name object for IMPLEMENTATION_VERSION.
- 
IMPLEMENTATION_VENDORManifest Attribute Name object for IMPLEMENTATION_VENDOR.
- 
COMPATIBLEEnum indicating that extension is compatible with other Package Specification.
- 
REQUIRE_SPECIFICATION_UPGRADEEnum indicating that extension requires an upgrade of specification to be compatible with other Package Specification.
- 
REQUIRE_VENDOR_SWITCHEnum indicating that extension requires a vendor switch to be compatible with other Package Specification.
- 
REQUIRE_IMPLEMENTATION_CHANGEEnum indicating that extension requires an upgrade of implementation to be compatible with other Package Specification.
- 
INCOMPATIBLEThis enum indicates that an extension is incompatible with other Package Specification in ways other than other enums indicate. For example, the other Package Specification may have a different ID.
 
- 
- 
Constructor Details- 
Specificationpublic Specification(String specificationTitle, String specificationVersion, String specificationVendor, String implementationTitle, String implementationVersion, String implementationVendor) The constructor to create Package Specification object. Note that every component is allowed to be specified but only the specificationTitle is mandatory.- Parameters:
- specificationTitle- the name of specification.
- specificationVersion- the specification Version.
- specificationVendor- the specification Vendor.
- implementationTitle- the title of implementation.
- implementationVersion- the implementation Version.
- implementationVendor- the implementation Vendor.
 
- 
Specificationpublic Specification(String specificationTitle, String specificationVersion, String specificationVendor, String implementationTitle, String implementationVersion, String implementationVendor, String[] sections) The constructor to create Package Specification object. Note that every component is allowed to be specified but only the specificationTitle is mandatory.- Parameters:
- specificationTitle- the name of specification.
- specificationVersion- the specification Version.
- specificationVendor- the specification Vendor.
- implementationTitle- the title of implementation.
- implementationVersion- the implementation Version.
- implementationVendor- the implementation Vendor.
- sections- the sections/packages that Specification applies to.
 
 
- 
- 
Method Details- 
getSpecificationsReturn an array ofPackage Specificationobjects. If there are no such optional packages, a zero-length array is returned.- Parameters:
- manifest- Manifest to be parsed
- Returns:
- the Package Specifications extensions in specified manifest
- Throws:
- ParseException- if the attributes of the specifications cannot be parsed according to their expected formats.
 
- 
getSpecificationTitleGet the title of the specification.- Returns:
- the title of specification
 
- 
getSpecificationVendorGet the vendor of the specification.- Returns:
- the vendor of the specification.
 
- 
getImplementationTitleGet the title of the specification.- Returns:
- the title of the specification.
 
- 
getSpecificationVersionGet the version of the specification.- Returns:
- the version of the specification.
 
- 
getImplementationVendorGet the vendor of the extensions implementation.- Returns:
- the vendor of the extensions implementation.
 
- 
getImplementationVersionGet the version of the implementation.- Returns:
- the version of the implementation.
 
- 
getSectionsReturn an array containing sections to which specification applies or null if relevant to no sections.- Returns:
- an array containing sections to which specification applies or null if relevant to no sections.
 
- 
getCompatibilityWithReturn a Compatibility enum indicating the relationship of thisPackage Specificationwith the specifiedExtension.- Parameters:
- other- the other specification
- Returns:
- the enum indicating the compatibility (or lack thereof) of specified Package Specification
 
- 
isCompatibleWithReturntrueif the specifiedpackageis satisfied by thisSpecification. Otherwise, returnfalse.- Parameters:
- other- the specification
- Returns:
- true if the specification is compatible with this specification
 
- 
toString
 
-