public class NodeSelector extends NodeTest
This is needed for C#, where it is not possible for a method such as NodeInfo.iterateAxis(int, NodePredicate)
to accept either a NodeTest object or a Predicate supplied as a lambda expression. To supply a predicate, it is
therefore necessary to wrap it in a NodePredicate.
| Modifier and Type | Method and Description |
|---|---|
double |
getDefaultPriority()
Determine the default priority to use if this node-test appears as a match pattern
for a template with no explicit priority attribute.
|
UType |
getUType()
Get the corresponding
UType. |
boolean |
matches(int nodeKind,
NodeName name,
SchemaType annotation)
Test whether this node test is satisfied by a given node.
|
static NodeSelector |
of(java.util.function.Predicate<? super NodeInfo> predicate)
Create a NodeTest based on a supplied predicate.
|
boolean |
test(NodeInfo node)
Test whether this node test is satisfied by a given node.
|
copy, explainMismatch, getAtomizedItemType, getBasicAlphaCode, getContentType, getFingerprint, getGenre, getMatcher, getMatchingNodeName, getPrimitiveItemType, getPrimitiveType, getRequiredNodeNames, isAtomicType, isAtomizable, isNillable, isPlainType, matches, one, oneOrMore, toShortString, zeroOrMore, zeroOrOneclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFullAlphaCode, getNormalizedDefaultPriority, toExportStringpublic static NodeSelector of(java.util.function.Predicate<? super NodeInfo> predicate)
predicate - the supplied predicate (a boolean function of a node)public boolean test(NodeInfo node)
NodeTestNodeTest.matches(int, NodeName, SchemaType)test in interface NodePredicatetest in class NodeTestnode - the node to be matchedpublic double getDefaultPriority()
NodeTestgetDefaultPriority in interface ItemTypegetDefaultPriority in class NodeTestpublic boolean matches(int nodeKind,
NodeName name,
SchemaType annotation)
NodeTestmatches in class NodeTestnodeKind - 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. Null means no constraint.Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.