Package net.sf.saxon.pattern
Class MultipleNodeKindTest
java.lang.Object
net.sf.saxon.pattern.NodeTest
net.sf.saxon.pattern.MultipleNodeKindTest
- All Implemented Interfaces:
NodePredicate,ItemType,ItemTypeWithSequenceTypeCache
An MultipleNodeKindTest is a nodetest that matches nodes belonging to any subset of possible
node kinds, for example element and document nodes, or attribute and namespace nodes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MultipleNodeKindTeststatic final MultipleNodeKindTeststatic final MultipleNodeKindTeststatic final MultipleNodeKindTest -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandoubleDetermine the default priority to use if this pattern appears as a match pattern for a template with no explicit priority attribute.getMatcher(NodeVectorTree tree) Get a matching function that can be used to test whether numbered nodes in a TinyTree or DominoTree satisfy the node test.getUType()Get the correspondingUType.inthashCode()Returns a hash code value for the object.booleanmatches(int nodeKind, NodeName name, SchemaType annotation) Test whether this node test is satisfied by a given node.booleanTest whether this node test is satisfied by a given node.Return a string representation of this ItemType suitable for use in stylesheet export files.toString()Methods inherited from class net.sf.saxon.pattern.NodeTest
copy, explainMismatch, getAtomizedItemType, getBasicAlphaCode, getContentType, getFingerprint, getGenre, getMatchingNodeName, getPrimitiveItemType, getPrimitiveType, getRequiredNodeNames, isAtomicType, isAtomizable, isNillable, isPlainType, matches, one, oneOrMore, zeroOrMore, zeroOrOneMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.type.ItemType
getFullAlphaCode, getNormalizedDefaultPriority
-
Field Details
-
PARENT_NODE
-
DOC_ELEM_ATTR
-
LEAF
-
CHILD_NODE
-
-
Constructor Details
-
MultipleNodeKindTest
-
-
Method Details
-
getUType
Get the correspondingUType. A UType is a union of primitive item types.- Returns:
- the smallest UType that subsumes this item type
-
matches
Test whether this node test is satisfied by a given node. This method is only fully supported for a subset of NodeTests, because it doesn't provide all the information needed to evaluate all node tests. In particular (a) it can't be used to evaluate a node test of the form element(N,T) or schema-element(E) where it is necessary to know whether the node is nilled, and (b) it can't be used to evaluate a node test of the form document-node(element(X)). This in practice means that it is used (a) to evaluate the simple node tests found in the XPath 1.0 subset used in XML Schema, and (b) to evaluate node tests where the node kind is known to be an attribute.- Specified by:
matchesin classNodeTest- Parameters:
nodeKind- The kind of node to be matchedname- identifies the expanded name of the node to be matched. The value should be null for a node with no name.annotation- The actual content type of the node- Returns:
- true if the node matches this node test
-
getMatcher
Description copied from class:NodeTestGet a matching function that can be used to test whether numbered nodes in a TinyTree or DominoTree satisfy the node test. (Calling this matcher must give the same result as callingmatchesNode(tree.getNode(nodeNr)), but it may well be faster).- Overrides:
getMatcherin classNodeTest- Parameters:
tree- the tree against which the returned function will operate- Returns:
- an IntPredicate; the matches() method of this predicate takes a node number as input, and returns true if and only if the node identified by this node number matches the node test.
-
test
Test whether this node test is satisfied by a given node. This alternative method is used in the case of nodes where calculating the fingerprint is expensive, for example DOM or JDOM nodes.- Specified by:
testin interfaceNodePredicate- Overrides:
testin classNodeTest- Parameters:
node- the node to be matched- Returns:
- true if the node test is satisfied by the supplied node, false otherwise
-
getDefaultPriority
public double getDefaultPriority()Determine the default priority to use if this pattern appears as a match pattern for a template with no explicit priority attribute.- Specified by:
getDefaultPriorityin interfaceItemType- Specified by:
getDefaultPriorityin classNodeTest- Returns:
- the default priority for the pattern
-
toString
-
toShortString
- Overrides:
toShortStringin classNodeTest
-
toExportString
Description copied from interface:ItemTypeReturn a string representation of this ItemType suitable for use in stylesheet export files. This differs from the result of toString() in that it will not contain any references to anonymous types. Note that it may also use the Saxon extended syntax for union types and tuple types. The default implementation returns the result of callingtoString().- Returns:
- the string representation as an instance of the XPath SequenceType construct
-
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
-