Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.saxonica.schema
Class EnumerationFacet

    java.lang.Object
      com.saxonica.schema.Facet
          com.saxonica.schema.EnumerationFacet

All Implemented Interfaces:
  java.io.Serializable

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.

See Also:
  Serialized Form

Field Summary

Fields inherited from class com.saxonica.schema.Facet
`ENUMERATION, FRACTIONDIGITS, LENGTH, MAX_EXCLUSIVE, MAX_INCLUSIVE, MAX_LENGTH, MIN_EXCLUSIVE, MIN_INCLUSIVE, MIN_LENGTH, PATTERN, TOTALDIGITS, value, WHITESPACE`

Constructor Summary
`EnumerationFacet()`

Method Summary
`void` | `checkFacetRestriction(UserSimpleType type, SimpleType base)` Check that this facet is legal when used on a type derived by restriction
`java.lang.String` | `getName()` Get the name of this facet
`AtomicValue` | `getTypedValue(UserAtomicType type)` Get the typed value of the enumeration value
`void` | `setNamespaceContext(NamespaceResolver map)` Save the namespace context for this enumeration value.
`void` | `setValue(java.lang.String value)` Set the value of this facet
`boolean` | `testAtomicValue(AtomicValue value)` Test whether an atomic value conforms to this facet

Methods inherited from class com.saxonica.schema.Facet
`appliesToWholeList, getValue, getWhitespaceAction, isFixed, setFixed, testLength, toLong`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### EnumerationFacet

    public EnumerationFacet()

Method Detail

### getName

    public java.lang.String getName()

  Get the name of this facet

  Overrides:
    `getName` in class `Facet`
  Returns:
    "enumeration"

### setValue

    public void setValue(java.lang.String value)

  Set the value of this facet

  Parameters:
    `value` - the raw enumeration value as written in the schema

### getTypedValue

    public AtomicValue getTypedValue(UserAtomicType type)
                              throws SchemaException,
                                     UnresolvedReferenceException

  Get the typed value of the enumeration value

  Parameters:
    `type` - the simple type containing this facet
  Returns:
    the enumeration value as written, converted to the simple type on which it appears.
  Throws:
    `SchemaException`
    `UnresolvedReferenceException`

### checkFacetRestriction

    public void checkFacetRestriction(UserSimpleType type,
                                      SimpleType base)
                               throws SchemaException,
                                      UnresolvedReferenceException

  Check that this facet is legal when used on a type derived by restriction

  Overrides:
    `checkFacetRestriction` in class `Facet`
  Parameters:
    `base` - the type from which the restricted type is derived
    `type` - the type on which the facet is defined
  Throws:
    `SchemaException` - if the facet value is not legal given the base type
    `UnresolvedReferenceException`

### setNamespaceContext

    public void setNamespaceContext(NamespaceResolver map)

  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

    public boolean testAtomicValue(AtomicValue value)

  Test whether an atomic value conforms to this facet

  Overrides:
    `testAtomicValue` in class `Facet`
  Parameters:
    `value` - the value to be tested
  Returns:
    true if the value conforms; false if it doesn't conform, or if the test fails. This implementation of the method should not be called, so it always returns true.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD