public interface UnionType extends ItemType, CastingTarget
ItemType.WithSequenceTypeCache
Modifier and Type | Method and Description |
---|---|
ValidationFailure |
checkAgainstFacets(AtomicValue value,
ConversionRules rules)
Validate an atomic value, which is known to be an instance of one of the member types of the
union, against any facets (pattern facets or enumeration facets) defined at the level of the
union itself.
|
boolean |
containsListType()
Ask whether the union contains a list type among its member types
|
default java.util.Optional<java.lang.String> |
explainMismatch(Item item,
TypeHierarchy th)
Get extra diagnostic information about why a supplied item does not conform to this
item type, if available.
|
default java.lang.String |
getDescription() |
java.lang.Iterable<? extends PlainType> |
getPlainMemberTypes()
Get the "plain" types in the transitive membership.
|
SequenceType |
getResultTypeOfCast()
Get the result type of a cast operation to this union type, as a sequence type.
|
default StructuredQName |
getStructuredQName() |
AtomicSequence |
getTypedValue(java.lang.CharSequence value,
NamespaceResolver resolver,
ConversionRules rules)
Get the typed value corresponding to a given string value, assuming it is
valid against this type
|
StructuredQName |
getTypeName()
Get the name of the type.
|
getAtomizedItemType, getBasicAlphaCode, getDefaultPriority, getFullAlphaCode, getGenre, getNormalizedDefaultPriority, getPrimitiveItemType, getPrimitiveType, getUType, isAtomicType, isAtomizable, isPlainType, isTrueItemType, matches, toExportString, toString
StructuredQName getTypeName()
NamespaceConstant.ANONYMOUS
namespacedefault StructuredQName getStructuredQName()
boolean containsListType() throws MissingComponentException
MissingComponentException
java.lang.Iterable<? extends PlainType> getPlainMemberTypes() throws MissingComponentException
MissingComponentException
SequenceType getResultTypeOfCast()
AtomicSequence getTypedValue(java.lang.CharSequence value, NamespaceResolver resolver, ConversionRules rules) throws ValidationException
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 configurationAtomicValue
,ValidationException
- if the supplied value is not in the lexical space of the data typeValidationFailure checkAgainstFacets(AtomicValue value, ConversionRules rules)
value
- the Atomic Value to be checked. This must be an instance of a member type of the
unionrules
- the ConversionRules for the Configurationdefault java.util.Optional<java.lang.String> explainMismatch(Item item, TypeHierarchy th)
explainMismatch
in interface ItemType
item
- the item that doesn't match this typeth
- the type hierarchy cachedefault java.lang.String getDescription()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.