Package org.rumbledb.types
Enum Class WhitespaceFacet
- All Implemented Interfaces:
Serializable,Comparable<WhitespaceFacet>,Constable
Represents the three legal values of the
whiteSpace constraining facet
as defined in XSD 1.1 Part 2, Section 4.3.6.
"whiteSpace constrains the value space of types derived from string such that the various behaviors specified in Attribute Value Normalization in XML are realized. The value of whiteSpace must be one of {preserve, replace, collapse}."
PRESERVEโ "No normalization is done, the value is not changed (this is the behavior required by XML for element content)"REPLACEโ "All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are replaced with #x20 (space)"COLLAPSEโ "After the processing implied by replace, contiguous sequences of #x20's are collapsed to a single #x20, and any #x20 at the start or end of the string is then removed."
Applicability rules from the spec:
"whiteSpace is applicable to all atomic and list datatypes. For all atomic datatypes other than string (and types derived by facet-based restriction from it) the value of whiteSpace is collapse and cannot be changed by a schema author; for string the value of whiteSpace is preserve; for any type derived by facet-based restriction from string the value of whiteSpace can be any of the three legal values (as long as the value is at least as restrictive as the value of the base type)."
The enum constants are declared in restriction order (PRESERVE <
REPLACE < COLLAPSE) so that Enum.ordinal() comparisons
correctly enforce the constraint that a derived type may only make the facet
more restrictive, never less.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic WhitespaceFacetReturns the enum constant of this class with the specified name.static WhitespaceFacet[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PRESERVE
-
REPLACE
-
COLLAPSE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-