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.
Get 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 calling matchesNode(tree.getNode(nodeNr)), but it may well be faster).
the type of node matched by this pattern. e.g. Type.ELEMENT or Type.TEXT
public java.util.Optional<IntSet> getRequiredNodeNames()
Get the set of node names allowed by this NodeTest. This is returned as a set of Integer fingerprints.
A null value indicates that all names are permitted (i.e. that there are no constraints on the node name.
The default implementation returns null.
Get an alphabetic code representing the type, or at any rate, the nearest built-in type
from which this type is derived. The codes are designed so that for any two built-in types
A and B, alphaCode(A) is a prefix of alphaCode(B) if and only if A is a supertype of B.
the alphacode for the nearest containing built-in type
public java.util.Optional<java.lang.String> explainMismatch(Item item,
Get extra diagnostic information about why a supplied item does not conform to this
item type, if available. If extra information is returned, it should be in the form of a complete
sentence, minus the closing full stop. No information should be returned for obvious cases.