Package net.sf.saxon.type.gnode
Class XNodeType
java.lang.Object
net.sf.saxon.type.gnode.GNodeType
net.sf.saxon.type.gnode.XNodeType
- All Implemented Interfaces:
NodePredicate,NodeTest,ItemType,ItemTypeWithSequenceTypeCache
- Direct Known Subclasses:
AnyXNodeType,DocumentNodeType,NamedXNodeType,NodeKindType,PortableNamedXNodeType
Abstract superclass for all item types that match XNodes only. There
are several subtypes:
AnyXNodeType: matches any XNodeNodeKindType: matches any XNode of a given kindNamedXNodeType: matches any XNode of a given kind, whose name matches aQNameTestand whose type annotation matches a given schema typeSchemaNodeTest: matches the typesschema-element(E)andschema-attribute(A)DocumentNodeType: matches the typedocument-node(E)* andschema-attribute(A)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasXNodeTest(Configuration config) Get an XNodeTest that will match any XNode that this NodeTest matches: that is, eliminate the possibility of matching a JNode.abstract QNameTestGet the set of allowed node names that this type if capable of matchinggetCoercionPlan(int version) Get the coercion plan for use when this type is the required type for (say) coercion of arguments in a function callGet the allowed content type permitted by this item type.getGenre()Determine the Genre (top-level classification) of this typeintgetRequiredFingerprint(int nodeKind) For anXNodeTypethat can only match one kind of node and one node name, return that node name, as an integer fingerprint.getUType()Get the correspondingUType.booleanAsk whether nodes that are nilled can match this type.Methods inherited from class net.sf.saxon.type.gnode.GNodeType
explainMismatch, getAtomizedItemType, getItemType, getPrimitiveItemType, getPrimitiveType, getQNameTest, isAtomicType, isAtomizable, isPlainType, matches, one, oneOrMore, test, toShortString, zeroOrMore, zeroOrOneMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.type.ItemType
asChoiceItemType, getBasicAlphaCode, getDefaultPriority, getNormalizedDefaultPriority, normalizeItemType, toExportStringMethods inherited from interface net.sf.saxon.pattern.nodetest.NodeTest
export, getDefaultPriority
-
Constructor Details
-
XNodeType
public XNodeType()
-
-
Method Details
-
getGenre
Determine the Genre (top-level classification) of this type -
asXNodeTest
Description copied from interface:NodeTestGet an XNodeTest that will match any XNode that this NodeTest matches: that is, eliminate the possibility of matching a JNode. -
getAllowedNodeNames
Get the set of allowed node names that this type if capable of matching- Returns:
- the allowed node names
-
getRequiredFingerprint
public int getRequiredFingerprint(int nodeKind) For anXNodeTypethat can only match one kind of node and one node name, return that node name, as an integer fingerprint. In other cases, return -1.- Parameters:
nodeKind- the kind of node required. If theXNodeTypedoes not match this node kind, return -1.- Returns:
- an integer fingerprint in the case of a node type that only matches one node kind and one qualified name. In other cases return -1.
-
getUType
Get the correspondingUType. A UType is a union of primitive item types. -
getContentType
Get the allowed content type permitted by this item type. Defaults to allowing any content- Overrides:
getContentTypein classGNodeType- Returns:
- the allowed content type
-
isNillable
public boolean isNillable()Ask whether nodes that are nilled can match this type. Defaults to true- Returns:
- true if the content test (when present) can match nodes that are nilled
-
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 classGNodeType- Parameters:
version- the XPath language version (40 or 31)
-