Package net.sf.saxon.type
Class EnumerationUnionType
java.lang.Object
net.sf.saxon.type.ChoiceItemType
net.sf.saxon.type.LocalUnionType
net.sf.saxon.type.EnumerationUnionType
- All Implemented Interfaces:
CastingTarget,ChoiceType,HyperType,ItemType,PlainType,UnionType
-
Field Summary
Fields inherited from class net.sf.saxon.type.ChoiceItemType
CHOICE_OF_ANY, CHOICE_OF_ATOMIC, CHOICE_OF_GNODE, CHOICE_OF_XNODE, memberTypes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCoercionPlan(int version) Get the coercion plan for use when this type is the required type for (say) coercion of arguments in a function calldoubleGet the default priority when this ItemType is used as an XSLT patternMethod defined in ItemType: get a primitive supertype in the ItemType type hierarchyintMethod defined in ItemType: get a primitive supertype in the ItemType type hierarchygetTypedValue(UnicodeString value, NamespaceResolver resolver, ConversionRules rules) Get the typed value corresponding to a given string value, assuming it is valid against this typebooleanAsk whether this Simple Type is an atomic typebooleanAsk whether this type is an IDREF or IDREFS type.booleanisIdType()Ask whether this type is an ID type.booleanTest whether this type is namespace sensitive, that is, if a namespace context is needed to translate between the lexical space and the value space.booleanTest whether a given item conforms to this typestatic EnumerationUnionTypeCreate an enumeration type permitting a defined set of valuestoString()Produce a string representation of the type name.validateContent(UnicodeString value, NamespaceResolver nsResolver, ConversionRules rules) Check whether a given input string is valid according to this SimpleTypeMethods inherited from class net.sf.saxon.type.LocalUnionType
checkAgainstFacets, containsListType, getAtomizedItemType, getGenre, getPlainMemberTypes, getResultTypeOfCast, getTypeName, isAtomizable, isBuiltInType, isListType, isPlainType, isUnionType, ofMethods inherited from class net.sf.saxon.type.ChoiceItemType
asChoiceItemType, eliminating, equals, expand, explainMismatch, getAlternatives, getBasicAlphaCode, getMemberTypes, getUType, hashCode, makeChoiceItemType, of, of, someMemberTypeSatisfies, toExportString, toMultipleNodeKindTestMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.type.ItemType
asChoiceItemType, explainMismatch, getBasicAlphaCode, getNormalizedDefaultPriority, getUType, normalizeItemType, toExportStringMethods inherited from interface net.sf.saxon.type.UnionType
getAlternatives, getStructuredQName
-
Constructor Details
-
EnumerationUnionType
-
-
Method Details
-
of
Create an enumeration type permitting a defined set of values- Parameters:
values- the values to be permitted. Must be Latin1 strings.
-
isAtomicType
public boolean isAtomicType()Description copied from class:LocalUnionTypeAsk whether this Simple Type is an atomic type- Specified by:
isAtomicTypein interfaceItemType- Overrides:
isAtomicTypein classLocalUnionType- Returns:
- false, this is not an atomic type
-
getDefaultPriority
public double getDefaultPriority()Description copied from class:ChoiceItemTypeGet the default priority when this ItemType is used as an XSLT pattern- Specified by:
getDefaultPriorityin interfaceItemType- Overrides:
getDefaultPriorityin classChoiceItemType- Returns:
- the default priority. For a choice type this is defined as the maximum of the default priorities of the member types.
-
isIdType
public boolean isIdType()Ask whether this type is an ID type. This is defined to be any simple type who typed value may contain atomic values of type xs:ID: that is, it includes types derived from ID by restriction, list, or union. Note that for a node to be treated as an ID in XSD 1.0, its typed value must be a *single* atomic value of type ID; the type of the node, however, can still allow a list or union. This changes in XSD 1.1, where a list of IDs is allowed.- Overrides:
isIdTypein classLocalUnionType
-
isIdRefType
public boolean isIdRefType()Ask whether this type is an IDREF or IDREFS type. This is defined to be any simple type who typed value may contain atomic values of type xs:IDREF: that is, it includes types derived from IDREF or IDREFS by restriction, list, or union- Overrides:
isIdRefTypein classLocalUnionType
-
isNamespaceSensitive
public boolean isNamespaceSensitive()Test whether this type is namespace sensitive, that is, if a namespace context is needed to translate between the lexical space and the value space. This is true for types derived from, or containing, QNames and NOTATIONs- Specified by:
isNamespaceSensitivein interfaceHyperType- Overrides:
isNamespaceSensitivein classLocalUnionType- Returns:
- true if any of the member types is namespace-sensitive, or if namespace sensitivity cannot be determined because there are components missing from the schema.
-
validateContent
public ValidationFailure validateContent(UnicodeString value, NamespaceResolver nsResolver, ConversionRules rules) Check whether a given input string is valid according to this SimpleType- Overrides:
validateContentin classLocalUnionType- Parameters:
value- the input string to be checkednsResolver- 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.rules- the configuration-wide conversion rules- Returns:
- null if validation succeeds; return a ValidationFailure describing the validation failure if validation fails
- Throws:
UnsupportedOperationException- if the type is namespace-sensitive and no namespace resolver is supplied
-
getTypedValue
public StringValue getTypedValue(UnicodeString value, NamespaceResolver resolver, ConversionRules rules) throws ValidationException Get the typed value corresponding to a given string value, assuming it is valid against this type- Specified by:
getTypedValuein interfaceUnionType- Overrides:
getTypedValuein classLocalUnionType- Parameters:
value- the string valueresolver- 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.rules- the conversion rules from the configuration- Returns:
- the atomic sequence comprising the typed value. The objects
returned by this SequenceIterator will all be of type
AtomicValue, - Throws:
ValidationException- if the supplied value is not in the lexical space of the data type
-
matches
Test whether a given item conforms to this type -
getPrimitiveItemType
Method defined in ItemType: get a primitive supertype in the ItemType type hierarchy- Specified by:
getPrimitiveItemTypein interfaceItemType- Specified by:
getPrimitiveItemTypein interfacePlainType- Overrides:
getPrimitiveItemTypein classLocalUnionType- Returns:
- BuiltInAtomicType.ANY_ATOMIC
-
getPrimitiveType
public int getPrimitiveType()Method defined in ItemType: get a primitive supertype in the ItemType type hierarchy- Specified by:
getPrimitiveTypein interfaceItemType- Overrides:
getPrimitiveTypein classLocalUnionType- Returns:
- StandardNames.XS_ANY_ATOMIC_TYPE
-
getCoercionPlan
Get the coercion plan for use when this type is the required type for (say) coercion of arguments in a function call- Specified by:
getCoercionPlanin interfaceItemType- Overrides:
getCoercionPlanin classLocalUnionType- Parameters:
version- the XPath language version (40 or 31)
-
getDescription
- Specified by:
getDescriptionin interfaceUnionType- Overrides:
getDescriptionin classChoiceItemType
-
toString
Produce a string representation of the type name. If the type is anonymous, an internally-allocated type name will be returned.- Overrides:
toStringin classChoiceItemType- Returns:
- the name of the atomic type in the form Q{uri}local
-