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.
| Modifier and Type | Field and Description |
|---|---|
| public static final Compatibility | COMPATIBLE
Enum indicating that extension is compatible with other Package Specification. |
| public static final Attributes. | IMPLEMENTATION_TITLE
Manifest Attribute Name object for IMPLEMENTATION_TITLE. |
| public static final Attributes. | IMPLEMENTATION_VENDOR
Manifest Attribute Name object for IMPLEMENTATION_VENDOR. |
| public static final Attributes. | IMPLEMENTATION_VERSION
Manifest Attribute Name object for IMPLEMENTATION_VERSION. |
| private String | implementationTitle
The title of implementation. |
| private String | implementationVendor
The name of the company or organization that produced this implementation of this specification. |
| private String | implementationVersion
The version string for implementation. |
| public static final Compatibility | INCOMPATIBLE
This enum indicates that an extension is incompatible with other Package Specification in ways other than other enums indicate. |
| private static final String | |
| public static final Compatibility | REQUIRE_IMPLEMENTATION_CHANGE
Enum indicating that extension requires an upgrade of implementation to be compatible with other Package Specification. |
| public static final Compatibility | REQUIRE_SPECIFICATION_UPGRADE
Enum indicating that extension requires an upgrade of specification to be compatible with other Package Specification. |
| public static final Compatibility | REQUIRE_VENDOR_SWITCH
Enum indicating that extension requires a vendor switch to be compatible with other Package Specification. |
| private String[] | sections
The sections of jar that the specification applies to. |
| public static final Attributes. | SPECIFICATION_TITLE
Manifest Attribute Name object for SPECIFICATION_TITLE. |
| public static final Attributes. | SPECIFICATION_VENDOR
Manifest Attribute Name object for SPECIFICATION_VENDOR. |
| public static final Attributes. | SPECIFICATION_VERSION
Manifest Attribute Name object for SPECIFICATION_VERSION. |
| private String | specificationTitle
The name of the Package Specification. |
| private String | specificationVendor
The name of the company or organization that originated the specification to which this specification conforms. |
| private DeweyDecimal | specificationVersion
The version number (dotted decimal notation) of the specification to which this optional package conforms. |
| Access | Constructor and Description |
|---|---|
| public | Specification(final String
the name of specification. specificationTitle, final String the specification Version. specificationVersion, final String the specification Vendor. specificationVendor, final String the title of implementation. implementationTitle, final String the implementation Version. implementationVersion, final String the implementation Vendor. implementationVendor)The constructor to create Package Specification object. |
| public | Specification(final String
the name of specification. specificationTitle, final String the specification Version. specificationVersion, final String the specification Vendor. specificationVendor, final String the title of implementation. implementationTitle, final String the implementation Version. implementationVersion, final String the implementation Vendor. implementationVendor, final String[] the sections/packages that Specification applies to. sections)The constructor to create Package Specification object. |
| Modifier and Type | Method and Description |
|---|---|
| public Compatibility | Returns: the enum indicating the compatibility (or lack thereof) of specified Package Specificationthe other specification other)Return a Compatibility enum indicating the relationship of this
|
| public String | |
| public String | Returns: the vendor of the extensions implementation.Get the vendor of the extensions implementation. |
| public String | Returns: the version of the implementation.Get the version of the implementation. |
| public String[] | Returns: an array containing sections to which specification applies or null if relevant to no sections.Return an array containing sections to which specification applies or null if relevant to no sections. |
| private static Specification | Returns: the new Specification object, or nullAttributes to searched attributes)Extract an Package Specification from Attributes. |
| public static Specification[] | Returns: the Package Specifications extensions in specified manifestManifest to be parsed manifest)Return an array of |
| public String | |
| public String | Returns: the vendor of the specification.Get the vendor of the specification. |
| public DeweyDecimal | Returns: the version of the specification.Get the version of the specification. |
| private static String | Returns: the trimmed string or nullthe string to trim or null value)Trim the supplied string if the string is non-null |
| private boolean | isCompatible(final DeweyDecimal
First version number (dotted decimal) first, final DeweyDecimal Second version number (dotted decimal) second)Return |
| public boolean | Returns: true if the specification is compatible with this specificationthe specification other)Return |
| private static boolean | Returns: true if two specifications are equal except for their sections, else falseone specification specification, final Specification the other specification other)Test if two specifications are equal except for their sections. |
| private static Specification | Returns: the merged specificationthe specification specification, final List<String> the list of sections to merge sectionsToAdd)Merge the specified sections into specified section and return result. |
| private static List | Returns: an array list with all duplicates removedthe array of results to trim list)Combine all specifications objects that are identical except for the sections. |
| public String | Returns: string representation of object.Overrides java. |
| COMPATIBLE | back to summary |
|---|---|
| public static final Compatibility COMPATIBLE Enum indicating that extension is compatible with other Package Specification. | |
| IMPLEMENTATION_TITLE | back to summary |
|---|---|
| public static final Attributes. Manifest Attribute Name object for IMPLEMENTATION_TITLE. | |
| IMPLEMENTATION_VENDOR | back to summary |
|---|---|
| public static final Attributes. Manifest Attribute Name object for IMPLEMENTATION_VENDOR. | |
| IMPLEMENTATION_VERSION | back to summary |
|---|---|
| public static final Attributes. Manifest Attribute Name object for IMPLEMENTATION_VERSION. | |
| implementationTitle | back to summary |
|---|---|
| private String implementationTitle The title of implementation. | |
| implementationVendor | back to summary |
|---|---|
| private String implementationVendor The name of the company or organization that produced this implementation of this specification. | |
| implementationVersion | back to summary |
|---|---|
| private String implementationVersion The version string for implementation. The version string is opaque. | |
| INCOMPATIBLE | back to summary |
|---|---|
| public static final Compatibility INCOMPATIBLE This 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. | |
| MISSING | back to summary |
|---|---|
| private static final String MISSING | |
| REQUIRE_IMPLEMENTATION_CHANGE | back to summary |
|---|---|
| public static final Compatibility REQUIRE_IMPLEMENTATION_CHANGE Enum indicating that extension requires an upgrade of implementation to be compatible with other Package Specification. | |
| REQUIRE_SPECIFICATION_UPGRADE | back to summary |
|---|---|
| public static final Compatibility REQUIRE_SPECIFICATION_UPGRADE Enum indicating that extension requires an upgrade of specification to be compatible with other Package Specification. | |
| REQUIRE_VENDOR_SWITCH | back to summary |
|---|---|
| public static final Compatibility REQUIRE_VENDOR_SWITCH Enum indicating that extension requires a vendor switch to be compatible with other Package Specification. | |
| sections | back to summary |
|---|---|
| private String[] sections The sections of jar that the specification applies to. | |
| SPECIFICATION_TITLE | back to summary |
|---|---|
| public static final Attributes. Manifest Attribute Name object for SPECIFICATION_TITLE. | |
| SPECIFICATION_VENDOR | back to summary |
|---|---|
| public static final Attributes. Manifest Attribute Name object for SPECIFICATION_VENDOR. | |
| SPECIFICATION_VERSION | back to summary |
|---|---|
| public static final Attributes. Manifest Attribute Name object for SPECIFICATION_VERSION. | |
| specificationTitle | back to summary |
|---|---|
| private String specificationTitle The name of the Package Specification. | |
| specificationVendor | back to summary |
|---|---|
| private String specificationVendor The name of the company or organization that originated the specification to which this specification conforms. | |
| specificationVersion | back to summary |
|---|---|
| private DeweyDecimal specificationVersion The version number (dotted decimal notation) of the specification to which this optional package conforms. | |
| Specification | back to summary |
|---|---|
| public Specification(final String specificationTitle, final String specificationVersion, final String specificationVendor, final String implementationTitle, final String implementationVersion, final String implementationVendor) The constructor to create Package Specification object. Note that every component is allowed to be specified but only the specificationTitle is mandatory.
| |
| Specification | back to summary |
|---|---|
| public Specification(final String specificationTitle, final String specificationVersion, final String specificationVendor, final String implementationTitle, final String implementationVersion, final String implementationVendor, final String[] sections) The constructor to create Package Specification object. Note that every component is allowed to be specified but only the specificationTitle is mandatory.
| |
| getCompatibilityWith | back to summary |
|---|---|
| public Compatibility getCompatibilityWith(final Specification other) Return a Compatibility enum indicating the relationship of this
| |
| getImplementationTitle | back to summary |
|---|---|
| public String getImplementationTitle() Get the title of the specification.
| |
| getImplementationVendor | back to summary |
|---|---|
| public String getImplementationVendor() Get the vendor of the extensions implementation.
| |
| getImplementationVersion | back to summary |
|---|---|
| public String getImplementationVersion() Get the version of the implementation.
| |
| getSections | back to summary |
|---|---|
| public String[] getSections() Return an array containing sections to which specification applies or null if relevant to no sections.
| |
| getSpecification | back to summary |
|---|---|
| private static Specification getSpecification(final String section, final Attributes attributes) throws ParseException Extract an Package Specification from Attributes.
| |
| getSpecifications | back to summary |
|---|---|
| public static Specification[] getSpecifications(final Manifest manifest) throws ParseException Return an array of
| |
| getSpecificationTitle | back to summary |
|---|---|
| public String getSpecificationTitle() Get the title of the specification.
| |
| getSpecificationVendor | back to summary |
|---|---|
| public String getSpecificationVendor() Get the vendor of the specification.
| |
| getSpecificationVersion | back to summary |
|---|---|
| public DeweyDecimal getSpecificationVersion() Get the version of the specification.
| |
| getTrimmedString | back to summary |
|---|---|
| private static String getTrimmedString(final String value) Trim the supplied string if the string is non-null | |
| isCompatible | back to summary |
|---|---|
| private boolean isCompatible(final DeweyDecimal first, final DeweyDecimal second) Return
| |
| isCompatibleWith | back to summary |
|---|---|
| public boolean isCompatibleWith(final Specification other) Return
| |
| isEqual | back to summary |
|---|---|
| private static boolean isEqual(final Specification specification, final Specification other) Test if two specifications are equal except for their sections.
| |
| mergeInSections | back to summary |
|---|---|
| private static Specification mergeInSections(final Specification specification, final List<String> sectionsToAdd) Merge the specified sections into specified section and return result. If no sections to be added then just return original specification.
| |
| removeDuplicates | back to summary |
|---|---|
| private static List Combine all specifications objects that are identical except for the sections. Note this is very inefficient and should probably be fixed in the future.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return a String representation of this object. | |