Package com.saxonica.ee.schema
Class EnumerationFacetSet
java.lang.Object
com.saxonica.ee.schema.Facet
com.saxonica.ee.schema.EnumerationFacetSet
Represents the set of enumeration values defined on a single simple type, This is a "virtual" facet
that combines all the enumeration facets in one simple type definition.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnumerationValue
(AtomicSequence val, String stringValue) Add a permitted value to the set of enumeration values.void
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()
The name of this facet.getSharedInstance
(String value) Get an instance of the facet value that is stored in the schema rather than the instancegetSharedInstance
(AtomicSequence value) Get an instance of the facet value that is stored in the schema rather than the instanceGet the enumeration values, as stringsgetValue()
Get a string representation of the value of the facetvoid
serializeFacet
(SchemaModelSerializer serializer) Serialize this facetboolean
testAtomicValue
(AtomicValue value) Test whether an atomic value conforms to this facetboolean
testListValue
(AtomicSequence value) Test whether a list value conforms to this facet.Methods inherited from class com.saxonica.ee.schema.Facet
getConstraintName, getMessage, getWhitespaceAction, isConstraining, isFacetName, isFixed, isNewlyIntroduced, makeFacet, setFixed, setMessage, testLength, toLong
-
Constructor Details
-
EnumerationFacetSet
public EnumerationFacetSet()
-
-
Method Details
-
getName
The name of this facet. -
getStringValues
Get the enumeration values, as strings- Returns:
- the list of strings in the enumeration facets
-
addEnumerationValue
Add a permitted value to the set of enumeration values. For internal use only.- Parameters:
val
- the value to be added. This must be an atomic value or a sequence of atomic values.stringValue
- the string value of the facet as written
-
getValue
Get a string representation of the value of the facet -
checkFacetRestriction
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
-
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
-
testListValue
Test whether a list value conforms to this facet. This is used only for the enumeration facet.- Overrides:
testListValue
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
-
serializeFacet
Serialize this facet- Overrides:
serializeFacet
in classFacet
- Parameters:
serializer
- receives the content for serialization- Throws:
XPathException
- if an error occurs writing the value to the output
-
getFacetAsFunctionItem
Description copied from class:Facet
Get a function item that represents this Facet schema component.- Specified by:
getFacetAsFunctionItem
in classFacet
-