Package com.saxonica.ee.schema
Class EnumerationFacet
java.lang.Object
com.saxonica.ee.schema.Facet
com.saxonica.ee.schema.EnumerationFacet
Represents a single enumeration facet defined on a simple type. Note that unlike other
facets, a value cannot be validated against a single enumeration facet; for this reason
all the individual enumeration facets are assembled into an
EnumerationFacetSet
which
is a pseudo-facet used to perform the validation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkFacetRestriction
(UserSimpleType type, SimpleType base, SchemaCompiler compiler) Check that this facet is legal when used on a type derived by restrictionGet a function item that represents this Facet schema component.getName()
Get the name of this facetGet the namespace context of the valuegetTypedValue
(SimpleType type, ConversionRules rules) Get the typed value of the enumeration valuegetValue()
Returns the lexical representation of this facetvoid
Save the namespace context for this enumeration value.void
Set the value of this facetboolean
testAtomicValue
(AtomicValue value) Test whether an atomic value conforms to this facetMethods inherited from class com.saxonica.ee.schema.Facet
getConstraintName, getMessage, getWhitespaceAction, isConstraining, isFacetName, isFixed, isNewlyIntroduced, makeFacet, serializeFacet, setFixed, setMessage, testLength, testListValue, toLong
-
Constructor Details
-
EnumerationFacet
public EnumerationFacet()
-
-
Method Details
-
getName
Get the name of this facet -
getValue
Returns the lexical representation of this facet -
getNamespaceContext
Get the namespace context of the value- Returns:
- the namespace context from the xs:enumeration element that defined the value
-
setValue
Set the value of this facet- Parameters:
value
- the raw enumeration value as written in the schema
-
getTypedValue
public AtomicSequence getTypedValue(SimpleType type, ConversionRules rules) throws SchemaException, MissingComponentException Get the typed value of the enumeration value- Parameters:
type
- the simple type containing this facetrules
- the conversion rules for the configuration- Returns:
- the enumeration value as written, converted to the simple type on which it appears. If the value is not valid against the type, throws a SchemaException
- Throws:
SchemaException
- if the schema is invalidMissingComponentException
- if an unresolved reference to a schema component is encountered
-
checkFacetRestriction
public void checkFacetRestriction(UserSimpleType type, SimpleType base, SchemaCompiler compiler) throws SchemaException, MissingComponentException Check that this facet is legal when used on a type derived by restriction- Overrides:
checkFacetRestriction
in classFacet
- Parameters:
type
- the type on which the facet is definedbase
- the type from which the restricted type is derivedcompiler
- the schema compiler- Throws:
SchemaException
- if the facet value is not legal given the base typeMissingComponentException
-
setNamespaceContext
Save the namespace context for this enumeration value. For internal use only.- Parameters:
map
- a NamespaceResolver mapping namespace prefixes (as strings) onto namespace URIs (as strings)
-
testAtomicValue
Test whether an atomic value conforms to this facet- Specified by:
testAtomicValue
in classFacet
- Parameters:
value
- the value to be tested- Returns:
- true if the value conforms; false if it doesn't conform, or if the test fails. The implementation of this method is called only while testing whether the enumeration values themselves conform to the type, so it always returns true.
-
getFacetAsFunctionItem
Description copied from class:Facet
Get a function item that represents this Facet schema component.- Specified by:
getFacetAsFunctionItem
in classFacet
-