public class LocalUnionType extends java.lang.Object implements PlainType, UnionType
Constructor and Description |
---|
LocalUnionType(AtomicType... memberTypes) |
LocalUnionType(java.util.List<AtomicType> memberTypes)
Creates a new Union type.
|
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 this union type includes any list types among its members
|
PlainType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item
of this type is atomized
|
java.lang.String |
getBasicAlphaCode()
Get an alphabetic code representing the type, or at any rate, the nearest built-in type
from which this type is derived.
|
double |
getDefaultPriority()
Get the default priority when this ItemType is used as an XSLT pattern
|
Genre |
getGenre()
Get the genre of this item
|
java.util.List<? extends AtomicType> |
getMemberTypes() |
java.util.List<? extends PlainType> |
getPlainMemberTypes()
Get the list of plain types that are subsumed by this type
|
AtomicType |
getPrimitiveItemType()
Method defined in ItemType: get a primitive supertype in the ItemType type hierarchy
|
int |
getPrimitiveType()
Method defined in ItemType: get a primitive supertype in the ItemType type hierarchy
|
SequenceType |
getResultTypeOfCast()
Get the SequenceType that most accurately describes the result of casting a value to this union type
|
AtomicValue |
getTypedValue(UnicodeString 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 this type as a structured QName
|
UType |
getUType()
Get the corresponding
UType . |
boolean |
isAtomicType()
Ask whether this Simple Type is an atomic type
|
boolean |
isAtomizable(TypeHierarchy th)
Ask whether values of this type are atomizable
|
boolean |
isBuiltInType()
Determine whether this is a built-in type or a user-defined type
|
boolean |
isIdRefType()
Ask whether this type is an IDREF or IDREFS type.
|
boolean |
isIdType()
Ask whether this type is an ID type.
|
boolean |
isListType()
Determine whether this is a list type
|
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.
|
boolean |
isPlainType()
Ask whether this Union type is a "plain type", defined as a union
type whose member types are all atomic types or plain unions.
|
boolean |
isUnionType()
Return true if this type is a union type (that is, if its variety is union)
|
boolean |
matches(Item item,
TypeHierarchy th)
Test whether a given item conforms to this type
|
java.lang.String |
toExportString()
Return a string representation of this ItemType suitable for use in stylesheet
export files.
|
java.lang.String |
toString()
Produce a string representation of the type name.
|
ValidationFailure |
validateContent(UnicodeString value,
NamespaceResolver nsResolver,
ConversionRules rules)
Check whether a given input string is valid according to this SimpleType
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
explainMismatch, getDescription, getStructuredQName
getFullAlphaCode, getNormalizedDefaultPriority
public LocalUnionType(java.util.List<AtomicType> memberTypes)
memberTypes
- the atomic member types of the unionpublic LocalUnionType(AtomicType... memberTypes)
public Genre getGenre()
public StructuredQName getTypeName()
PlainType
getTypeName
in interface PlainType
getTypeName
in interface UnionType
public java.util.List<? extends AtomicType> getMemberTypes()
public boolean isAtomicType()
isAtomicType
in interface ItemType
public boolean containsListType()
containsListType
in interface UnionType
public boolean isPlainType()
isPlainType
in interface ItemType
public SequenceType getResultTypeOfCast()
getResultTypeOfCast
in interface UnionType
public boolean isIdType()
public boolean isIdRefType()
public boolean isBuiltInType()
public boolean isListType()
public boolean isUnionType()
public UType getUType()
UType
. A UType is a union of primitive item
types.public java.lang.String getBasicAlphaCode()
getBasicAlphaCode
in interface ItemType
public boolean isNamespaceSensitive()
isNamespaceSensitive
in interface HyperType
public ValidationFailure validateContent(UnicodeString value, NamespaceResolver nsResolver, ConversionRules rules)
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 rulesjava.lang.UnsupportedOperationException
- if the type is namespace-sensitive and no namespace
resolver is suppliedpublic ValidationFailure checkAgainstFacets(AtomicValue value, ConversionRules rules)
checkAgainstFacets
in interface UnionType
value
- the Atomic Value to be checked. This must be an instance of a member type of the
unionrules
- the ConversionRules for the Configurationpublic AtomicValue getTypedValue(UnicodeString value, NamespaceResolver resolver, ConversionRules rules) throws ValidationException
UnionType
getTypedValue
in interface UnionType
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 typepublic boolean matches(Item item, TypeHierarchy th)
public AtomicType getPrimitiveItemType()
getPrimitiveItemType
in interface ItemType
getPrimitiveItemType
in interface PlainType
public int getPrimitiveType()
getPrimitiveType
in interface ItemType
public PlainType getAtomizedItemType()
ItemType
getAtomizedItemType
in interface ItemType
public boolean isAtomizable(TypeHierarchy th)
ItemType
isAtomizable
in interface ItemType
th
- the type hierarchy cachepublic java.util.List<? extends PlainType> getPlainMemberTypes()
getPlainMemberTypes
in interface PlainType
getPlainMemberTypes
in interface UnionType
public double getDefaultPriority()
getDefaultPriority
in interface ItemType
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toExportString()
ItemType
toString()
.toExportString
in interface ItemType
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.