Package org.odftoolkit.odfdom.dom
Enum OdfSchemaConstraint
- java.lang.Object
-
- java.lang.Enum<OdfSchemaConstraint>
-
- org.odftoolkit.odfdom.dom.OdfSchemaConstraint
-
- All Implemented Interfaces:
Serializable
,Comparable<OdfSchemaConstraint>
,ValidationConstraint
public enum OdfSchemaConstraint extends Enum<OdfSchemaConstraint> implements ValidationConstraint
This class is used for validation of the ODF Document. It contains the constraint messages are taken from the OASIS ODF 1.2 part 1, the XML Schema specification. These messages are used by theValidationException
for ODF validation. The validation is enabled, when anErrorHandler
was provided to theOdfPackage
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DOCUMENT_WITH_EXISTENT_BUT_UNREADABLE_CONTENT_OR_STYLES_XML
The files \'content.xml' or 'styles.xml' must be parsed without error when existent in the ODF XML Schema package.DOCUMENT_WITHOUT_CONTENT_NOR_STYLES_XML
At least \'content.xml' or 'styles.xml' have to be contained in the ODF XML Schema package.DOCUMENT_WITHOUT_ODF_MIMETYPE
A ODF mimetype is invalid for the ODF XML Schema document.DOCUMENT_XML_INVALID_ATTRIBUTE_VALUE
The XML is not valid according to the ODF RelaxNG schema.PACKAGE_SHALL_CONTAIN_MIMETYPE
The 'mimetype' file have to be contained in the ODF XML Schema package.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLocalizedMessage()
Creates a localized description of a Constraint.String
getMessage()
Returns the detail message string of this Constraint.static OdfSchemaConstraint
valueOf(String name)
Returns the enum constant of this type with the specified name.static OdfSchemaConstraint[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DOCUMENT_WITHOUT_ODF_MIMETYPE
public static final OdfSchemaConstraint DOCUMENT_WITHOUT_ODF_MIMETYPE
A ODF mimetype is invalid for the ODF XML Schema document.
-
DOCUMENT_WITHOUT_CONTENT_NOR_STYLES_XML
public static final OdfSchemaConstraint DOCUMENT_WITHOUT_CONTENT_NOR_STYLES_XML
At least \'content.xml' or 'styles.xml' have to be contained in the ODF XML Schema package.
-
DOCUMENT_WITH_EXISTENT_BUT_UNREADABLE_CONTENT_OR_STYLES_XML
public static final OdfSchemaConstraint DOCUMENT_WITH_EXISTENT_BUT_UNREADABLE_CONTENT_OR_STYLES_XML
The files \'content.xml' or 'styles.xml' must be parsed without error when existent in the ODF XML Schema package.
-
PACKAGE_SHALL_CONTAIN_MIMETYPE
public static final OdfSchemaConstraint PACKAGE_SHALL_CONTAIN_MIMETYPE
The 'mimetype' file have to be contained in the ODF XML Schema package.
-
DOCUMENT_XML_INVALID_ATTRIBUTE_VALUE
public static final OdfSchemaConstraint DOCUMENT_XML_INVALID_ATTRIBUTE_VALUE
The XML is not valid according to the ODF RelaxNG schema.
-
-
Method Detail
-
values
public static OdfSchemaConstraint[] 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 (OdfSchemaConstraint c : OdfSchemaConstraint.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OdfSchemaConstraint 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:
getLocalizedMessage
in interfaceValidationConstraint
- Returns:
- The localized description of this constraint.
-
getMessage
public String getMessage()
Returns the detail message string of this Constraint.- Specified by:
getMessage
in interfaceValidationConstraint
- Returns:
- the detail message string of this Constraint instance (which may be null).
-
-