Class EnumerationFacet

  • public class EnumerationFacet
    extends Facet
    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 Detail

      • EnumerationFacet

        public EnumerationFacet()
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name of this facet
        Specified by:
        getName in class Facet
      • getValue

        public java.lang.String getValue()
        Returns the lexical representation of this facet
        Specified by:
        getValue in class Facet
        the value of this facet
      • getNamespaceContext

        public NamespaceResolver getNamespaceContext()
        Get the namespace context of the value
        the namespace context from the xs:enumeration element that defined the value
      • setValue

        public void setValue​(java.lang.String value)
        Set the value of this facet
        value - the raw enumeration value as written in the schema
      • getTypedValue

        public AtomicSequence getTypedValue​(SimpleType type,
                                            ConversionRules rules)
                                     throws SchemaException,
        Get the typed value of the enumeration value
        type - the simple type containing this facet
        rules - the conversion rules for the configuration
        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
        SchemaException - if the schema is invalid
        MissingComponentException - if an unresolved reference to a schema component is encountered
      • setNamespaceContext

        public void setNamespaceContext​(NamespaceResolver map)
        Save the namespace context for this enumeration value. For internal use only.
        map - a NamespaceResolver mapping namespace prefixes (as strings) onto namespace URIs (as strings)
      • testAtomicValue

        public boolean testAtomicValue​(AtomicValue value)
        Test whether an atomic value conforms to this facet
        Specified by:
        testAtomicValue in class Facet
        value - the value to be tested
        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

        public Function getFacetAsFunctionItem()
        Description copied from class: Facet
        Get a function item that represents this Facet schema component.
        Specified by:
        getFacetAsFunctionItem in class Facet