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 UserUnionType

    java.lang.Object
      com.saxonica.schema.SchemaStructure
          com.saxonica.schema.SchemaTypeImpl
              com.saxonica.schema.UserSimpleType
                  com.saxonica.schema.UserUnionType

All Implemented Interfaces:
  SchemaComponent, SchemaType, java.io.Serializable, SimpleType, javax.xml.transform.SourceLocator

public class UserUnionType
extends UserSimpleType

A class that represents the XML Schema Union simple-type.

See Also:
  Serialized Form

Field Summary

Fields inherited from class com.saxonica.schema.SchemaTypeImpl
`finalProhibitions`

Fields inherited from interface net.sf.saxon.type.SchemaType
`DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION`

Fields inherited from interface net.sf.saxon.type.SchemaComponent
`FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING`

Constructor Summary
`UserUnionType(PreparedSchema schema)` Creates a new Union type.

Method Summary
`AtomicType` | `getCommonAtomicType()` Get the most specific possible atomic type that all items in this SimpleType belong to
`java.util.List` | `getMemberTypeReferences()` Get the list of member types, as a List containing TypeReference objects
`SequenceIterator` | `getTypedValue(java.lang.CharSequence value, NamespaceResolver resolver, NameChecker nameChecker)` Get the typed value corresponding to a given string value, assuming it is valid against this type
`boolean` | `isAtomicType()` Test whether this Simple Type is an atomic type
`boolean` | `isListType()` Determine whether this is a list type
`boolean` | `isUnionType()` Return true if this type is a union type (that is, if its variety is union)
`java.util.Iterator` | `iterateMemberTypeReferences()` Returns an Iterator over all the SimpleTypes that are members of a union type.
`void` | `setMemberTypeReferences(java.util.List members)` Set the member types of this union type
`boolean` | `validate(PreparedSchema schema)` Validate this Union, replacing all unresolved forwards references at the same time
`ValidationException` | `validateContent(java.lang.CharSequence value, NamespaceResolver nsResolver, NameChecker nameChecker)` Check whether a given input string is valid according to this SimpleType

Methods inherited from class com.saxonica.schema.UserSimpleType
`analyzeContentExpression, applyWhitespaceNormalization, atomize, getBuiltInBaseType, getFacet, getFacetCollection, getFacets, getFacets, getTypedValue, getWhitespaceAction, isNamespaceSensitive, isSimpleType, isTypeDerivationOK, isTypeDerivationOK, setFacetCollection`

Methods inherited from class com.saxonica.schema.SchemaTypeImpl
`allowsDerivation, containingDeclarationIsElement, getBaseType, getBaseTypeFingerprint, getBaseTypeReference, getBlock, getContainingDeclarationName, getDerivationMethod, getDescription, getDisplayName, getFingerprint, getLocalName, getNameCode, getNamePool, isComplexType, isSameType, setBaseTypeReference, setContainingDeclaration, setDerivationMethod, setDerivationMethodName, setFinalProhibitions, setLocalName, setNameCode, setNamePool`

Methods inherited from class com.saxonica.schema.SchemaStructure
`getColumnNumber, getFixupStatus, getLineNumber, getPublicId, getSchema, getSystemId, getValidationStatus, lookForCycles, setFixupStatus, setLineNumber, setLocator, setSchema, setSystemId, setValidationStatus`

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

Methods inherited from interface net.sf.saxon.type.SchemaType
`allowsDerivation, getBaseType, getBlock, getDerivationMethod, getDescription, getDisplayName, getFingerprint, getNameCode, isComplexType, isSameType`

Methods inherited from interface net.sf.saxon.type.SchemaComponent
`getValidationStatus`

Constructor Detail

### UserUnionType

    public UserUnionType(PreparedSchema schema)

  Creates a new Union type.

Parameters:
  `schema` - the Schema for this Union (Cannot be null)

Method Detail

### getCommonAtomicType

    public AtomicType getCommonAtomicType()

  Get the most specific possible atomic type that all items in this SimpleType belong to

  Returns:
    the lowest common supertype of all member types

### setMemberTypeReferences

    public void setMemberTypeReferences(java.util.List members)

  Set the member types of this union type

### getMemberTypeReferences

    public java.util.List getMemberTypeReferences()

  Get the list of member types, as a List containing TypeReference objects

### iterateMemberTypeReferences

    public java.util.Iterator iterateMemberTypeReferences()

  Returns an Iterator over all the SimpleTypes that are members of a union type. Note that this is not transitive: if the union has another union as a membertype, the iteration will return this union rather than its members.

  Returns:
    For union types, return an Iterator over all TypeReferences to member SimpleTypes.

### isAtomicType

    public boolean isAtomicType()

  Test whether this Simple Type is an atomic type

  Specified by:
    `isAtomicType` in interface `SimpleType`
  Overrides:
    `isAtomicType` in class `UserSimpleType`
  Returns:
    false, this is not an atomic type

### isListType

    public boolean isListType()

  Determine whether this is a list type

  Specified by:
    `isListType` in interface `SimpleType`
  Overrides:
    `isListType` in class `UserSimpleType`
  Returns:
    true if this is a list type

### isUnionType

    public boolean isUnionType()

  Return true if this type is a union type (that is, if its variety is union)

  Specified by:
    `isUnionType` in interface `SimpleType`
  Overrides:
    `isUnionType` in class `UserSimpleType`
  Returns:
    true for a union type

### validate

    public boolean validate(PreparedSchema schema)
                     throws SchemaException,
                            ValidationException

  Validate this Union, replacing all unresolved forwards references at the same time

  Overrides:
    `validate` in class `UserSimpleType`
  Parameters:
    `schema` - a Schema used for error reporting
  Throws:
    `SchemaException`
    `ValidationException`

### validateContent

    public ValidationException validateContent(java.lang.CharSequence value,
                                               NamespaceResolver nsResolver,
                                               NameChecker nameChecker)

  Check whether a given input string is valid according to this SimpleType

  Parameters:
    `value` - the input string to be checked
    `nsResolver` - a namespace resolver used to resolve namespace prefixes if the type is namespace sensitive. The value supplied may be null; in this case any namespace-sensitive content will throw an UnsupportedOperationException.
    `nameChecker` -
  Returns:
    null if validation succeeds; return a ValidationException describing the validation failure if validation fails, unless throwException is true, in which case the exception is thrown rather than being returned.
  Throws:
    `java.lang.UnsupportedOperationException` - if the type is namespace-sensitive and no namespace resolver is supplied

### getTypedValue

    public SequenceIterator getTypedValue(java.lang.CharSequence value,
                                          NamespaceResolver resolver,
                                          NameChecker nameChecker)
                                   throws ValidationException

  Description copied from interface: `SimpleType`
  Get the typed value corresponding to a given string value, assuming it is valid against this type

  Parameters:
    `value` - the string value
    `resolver` - a namespace resolver used to resolve any namespace prefixes appearing in the content of values. Can supply null, in which case any namespace-sensitive content will be rejected.
    `nameChecker` -
  Returns:
    an iterator over the atomic sequence comprising the typed value. The objects returned by this SequenceIterator will all be of type `AtomicValue`
  Throws:
    `ValidationException`

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