Package org.odftoolkit.odfdom.pkg
Enum OdfPackageConstraint
- java.lang.Object
-
- java.lang.Enum<OdfPackageConstraint>
-
- org.odftoolkit.odfdom.pkg.OdfPackageConstraint
-
- All Implemented Interfaces:
Serializable,Comparable<OdfPackageConstraint>,ValidationConstraint
public enum OdfPackageConstraint extends Enum<OdfPackageConstraint> implements ValidationConstraint
This class is used for validation of the ODF Package. It contains the constraint messages are taken from the OASIS ODF 1.2 part 3, the ODF package specification. These messages are used by theValidationExceptionfor ODF validation. The validation is enabled, when anErrorHandlerwas provided to theOdfPackage.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MANIFEST_DOES_NOT_LIST_DIRECTORYA directory is a document and should be listed in the \"/META-INF/manifest.xml\" file of ODF package.MANIFEST_DOES_NOT_LIST_FILEA file shall be listed in the \"/META-INF/manifest.xml\" file as it exists in the ODF package.MANIFEST_LISTS_DIRECTORYA directory is not a sub-document and should not be listed in the \"/META-INF/manifest.xml\" file of ODF package.MANIFEST_LISTS_NONEXISTENT_FILEA file shall not be listed in the \"/META-INF/manifest.xml\" file as it does not exist in the ODF package.MANIFEST_NOT_IN_PACKAGEThe ODF package shall contain the \"/META-INF/manifest.xml\" file.MANIFEST_WITH_EMPTY_PATHThe root document shall be listed in the \"/META-INF/manifest.xml\" file using '/' as path within the ODF package.MIMETYPE_DIFFERS_FROM_PACKAGEThe ODF package contains a \"mediatype\" file, which content differs from the mediatype of the root document!"MIMETYPE_HAS_EXTRA_FIELDThere shall be no extra field for the \"mediatype\" zip entry of ODF package.MIMETYPE_IS_COMPRESSEDThe file \"mediatype\" shall not be compressed in the ODF package.MIMETYPE_NOT_FIRST_IN_PACKAGEThe file \"mediatype\" is not the first zip entry in the ODF package.MIMETYPE_NOT_IN_PACKAGEThe ODF package contains no \"mediatype\" file.MIMETYPE_WITHOUT_MANIFEST_MEDIATYPEThe ODF package contains a \"mediatype\" file, but no mediatype for its root document in the \"/META-INF/manifest.xml\" file!PACKAGE_ENTRY_DUPLICATEPACKAGE_ENTRY_INVALID_FILE_NAMEsee PKWARE APPNOTE.TXT, 4.4.17 file namePACKAGE_ENTRY_USING_INVALID_COMPRESSIONIn case a ZIP entry is using neither STORED and DEFLATED as compression method.PACKAGE_IS_NO_ZIPThe ODF package shall be a ZIP file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLocalizedMessage()Creates a localized description of a Constraint.StringgetMessage()Returns the detail message string of this Constraint.static OdfPackageConstraintvalueOf(String name)Returns the enum constant of this type with the specified name.static OdfPackageConstraint[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PACKAGE_ENTRY_USING_INVALID_COMPRESSION
public static final OdfPackageConstraint PACKAGE_ENTRY_USING_INVALID_COMPRESSION
In case a ZIP entry is using neither STORED and DEFLATED as compression method.
-
PACKAGE_ENTRY_DUPLICATE
public static final OdfPackageConstraint PACKAGE_ENTRY_DUPLICATE
-
PACKAGE_ENTRY_INVALID_FILE_NAME
public static final OdfPackageConstraint PACKAGE_ENTRY_INVALID_FILE_NAME
see PKWARE APPNOTE.TXT, 4.4.17 file name
-
MANIFEST_NOT_IN_PACKAGE
public static final OdfPackageConstraint MANIFEST_NOT_IN_PACKAGE
The ODF package shall contain the \"/META-INF/manifest.xml\" file.
-
MANIFEST_LISTS_DIRECTORY
public static final OdfPackageConstraint MANIFEST_LISTS_DIRECTORY
A directory is not a sub-document and should not be listed in the \"/META-INF/manifest.xml\" file of ODF package.
-
MANIFEST_DOES_NOT_LIST_DIRECTORY
public static final OdfPackageConstraint MANIFEST_DOES_NOT_LIST_DIRECTORY
A directory is a document and should be listed in the \"/META-INF/manifest.xml\" file of ODF package.
-
MANIFEST_LISTS_NONEXISTENT_FILE
public static final OdfPackageConstraint MANIFEST_LISTS_NONEXISTENT_FILE
A file shall not be listed in the \"/META-INF/manifest.xml\" file as it does not exist in the ODF package.
-
MANIFEST_DOES_NOT_LIST_FILE
public static final OdfPackageConstraint MANIFEST_DOES_NOT_LIST_FILE
A file shall be listed in the \"/META-INF/manifest.xml\" file as it exists in the ODF package.
-
MIMETYPE_DIFFERS_FROM_PACKAGE
public static final OdfPackageConstraint MIMETYPE_DIFFERS_FROM_PACKAGE
The ODF package contains a \"mediatype\" file, which content differs from the mediatype of the root document!"
-
MIMETYPE_WITHOUT_MANIFEST_MEDIATYPE
public static final OdfPackageConstraint MIMETYPE_WITHOUT_MANIFEST_MEDIATYPE
The ODF package contains a \"mediatype\" file, but no mediatype for its root document in the \"/META-INF/manifest.xml\" file!
-
MANIFEST_WITH_EMPTY_PATH
public static final OdfPackageConstraint MANIFEST_WITH_EMPTY_PATH
The root document shall be listed in the \"/META-INF/manifest.xml\" file using '/' as path within the ODF package.
-
MIMETYPE_HAS_EXTRA_FIELD
public static final OdfPackageConstraint MIMETYPE_HAS_EXTRA_FIELD
There shall be no extra field for the \"mediatype\" zip entry of ODF package.
-
MIMETYPE_IS_COMPRESSED
public static final OdfPackageConstraint MIMETYPE_IS_COMPRESSED
The file \"mediatype\" shall not be compressed in the ODF package.
-
MIMETYPE_NOT_FIRST_IN_PACKAGE
public static final OdfPackageConstraint MIMETYPE_NOT_FIRST_IN_PACKAGE
The file \"mediatype\" is not the first zip entry in the ODF package.
-
MIMETYPE_NOT_IN_PACKAGE
public static final OdfPackageConstraint MIMETYPE_NOT_IN_PACKAGE
The ODF package contains no \"mediatype\" file.
-
PACKAGE_IS_NO_ZIP
public static final OdfPackageConstraint PACKAGE_IS_NO_ZIP
The ODF package shall be a ZIP file.
-
-
Method Detail
-
values
public static OdfPackageConstraint[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (OdfPackageConstraint c : OdfPackageConstraint.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OdfPackageConstraint valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getLocalizedMessage
public String getLocalizedMessage()
Creates a localized description of a Constraint. Subclasses may override this method in order to produce a locale-specific message. For subclasses that do not override this method, the default implementation returns the same result asgetMessage().- Specified by:
getLocalizedMessagein interfaceValidationConstraint- Returns:
- The localized description of this constraint.
-
getMessage
public String getMessage()
Returns the detail message string of this Constraint.- Specified by:
getMessagein interfaceValidationConstraint- Returns:
- the detail message string of this
Constraintinstance (which may benull).
-
-