public class TypeHierarchy
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
config |
| Constructor and Description |
|---|
TypeHierarchy(Configuration config)
Create the type hierarchy cache for a configuration
|
| Modifier and Type | Method and Description |
|---|---|
protected SequenceIterator |
applyFunctionCoercion(SequenceIterator iterator,
ItemType suppliedItemType,
ItemType requiredItemType,
Location locator)
Apply function coercion when a function item is supplied as a parameter in a function call
|
Sequence |
applyFunctionConversionRules(Sequence value,
SequenceType requiredType,
RoleDiagnostic role,
Location locator)
Apply the function conversion rules to a value, given a required type.
|
protected Affinity |
computeContentRelationship(ItemType t1,
ItemType t2,
java.util.Optional<IntSet> n1,
java.util.Optional<IntSet> n2)
Compute the relationship between the allowed content-types of two types,
for example attribute(*, xs:integer) and attribute(xs:string).
|
Configuration |
getConfiguration()
Get the Saxon configuration to which this type hierarchy belongs
|
ItemType |
getGenericFunctionItemType() |
static Affinity |
inverseRelationship(Affinity relation) |
boolean |
isSubType(ItemType subtype,
ItemType supertype)
Determine whether type A is type B or one of its subtypes, recursively.
|
Affinity |
relationship(ItemType t1,
ItemType t2)
Determine the relationship of one item type to another.
|
Affinity |
schemaTypeRelationship(SchemaType s1,
SchemaType s2)
Get the relationship of two schema types to each other
|
Affinity |
sequenceTypeRelationship(SequenceType s1,
SequenceType s2)
Get the relationship of two sequence types to each other
|
protected Configuration config
public TypeHierarchy(Configuration config)
config - the configurationpublic Sequence applyFunctionConversionRules(Sequence value, SequenceType requiredType, RoleDiagnostic role, Location locator) throws XPathException
value - a value to be convertedrequiredType - the required typerole - identifies the value to be converted in error messageslocator - identifies the location for error messagesXPathException - if the value cannot be converted to the required typeprotected SequenceIterator applyFunctionCoercion(SequenceIterator iterator, ItemType suppliedItemType, ItemType requiredItemType, Location locator)
iterator - An iterator over the supplied value of the parametersuppliedItemType - the item type of the supplied valuerequiredItemType - the required item type (typically a function item type)locator - information for diagnosticspublic Configuration getConfiguration()
public boolean isSubType(ItemType subtype, ItemType supertype)
subtype - identifies the first typesupertype - identifies the second typepublic Affinity relationship(ItemType t1, ItemType t2)
t1 - the first item typet2 - the second item typeAffinity.SAME_TYPE if the types are the same;Affinity.SUBSUMES if the first
type subsumes the second (that is, all instances of the second type are also instances
of the first);Affinity.SUBSUMED_BY if the second type subsumes the first;Affinity.OVERLAPS if the two types overlap (have a non-empty intersection, but neither
subsumes the other);Affinity.DISJOINT if the two types are disjoint (have an empty intersection)protected Affinity computeContentRelationship(ItemType t1, ItemType t2, java.util.Optional<IntSet> n1, java.util.Optional<IntSet> n2)
t1 - the first typet2 - the second typesn1 - the set of element names allowed by the first typen2 - the set of element names allowed by the second typepublic Affinity sequenceTypeRelationship(SequenceType s1, SequenceType s2)
s1 - the first types2 - the second typeAffinity.SAME_TYPE, Affinity.SUBSUMES,
Affinity.SUBSUMED_BY, Affinity.DISJOINT,
Affinity.OVERLAPSpublic Affinity schemaTypeRelationship(SchemaType s1, SchemaType s2)
s1 - the first types2 - the second typeAffinity.SAME_TYPE, Affinity.SUBSUMES,
Affinity.SUBSUMED_BY, Affinity.DISJOINT, Affinity.OVERLAPSpublic ItemType getGenericFunctionItemType()
Copyright (c) 2004-2021 Saxonica Limited. All rights reserved.