Package net.sf.saxon.pattern.nodetest
Class NodeTestStar
java.lang.Object
net.sf.saxon.pattern.nodetest.NodeTestStar
- All Implemented Interfaces:
NodePredicate,NodeTest
A node test representing the syntax
* - meaning either all
children of a JNode, or all children of the principal node kind of the axis
in the case of an XNode-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasXNodeTest(Configuration config) Convert to a test that only matches XNodesexplainMismatch(Item item, TypeHierarchy th) Get extra diagnostic information about why a supplied item does not conform to this item type, if available.intGet the default node kind of the axis used in the containing step.doubleDetermine the default priority to use if this node-test appears as a match pattern for a template with no explicit priority attribute.Get an item type that all matching nodes must satisfyExtract a QNameTest (the strongest one possible) that must be satisfied by a node if it is to satisfy this NodeTestgetUType()Get a UType that all matching nodes must satisfybooleanDetermine whether the content type (if present) is nillablebooleanTest whether this node test is satisfied by a given node.Get a concise string representation of this node test for use in diagnosticstoString()
-
Constructor Details
-
NodeTestStar
public NodeTestStar(int defaultNodeKind) Create the test- Parameters:
defaultNodeKind- the default node kind for the axis on which the node test appears. This is relevant only when the step is used to select within an XTree, but we need to keep the information "just in case".
-
-
Method Details
-
getDefaultNodeKind
public int getDefaultNodeKind()Get the default node kind of the axis used in the containing step.- Returns:
- the default node kind (always element, attribute, or namespace)
-
getDefaultPriority
public 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.- Specified by:
getDefaultPriorityin interfaceNodeTest- Returns:
- the default priority for the pattern
-
getQNameTest
Extract a QNameTest (the strongest one possible) that must be satisfied by a node if it is to satisfy this NodeTest- Specified by:
getQNameTestin interfaceNodeTest- Returns:
- the strongest possible QNameTest
-
asXNodeTest
Convert to a test that only matches XNodes- Specified by:
asXNodeTestin interfaceNodeTest
-
test
Test whether this node test is satisfied by a given node.- Specified by:
testin interfaceNodePredicate- Specified by:
testin interfaceNodeTest- Parameters:
node- the node to be matched- Returns:
- true if the node test is satisfied by the supplied node, false otherwise
-
getItemType
Get an item type that all matching nodes must satisfy- Specified by:
getItemTypein interfaceNodeTest- Returns:
- an item type
-
toString
-
getUType
Get a UType that all matching nodes must satisfy -
isNillable
public boolean isNillable()Determine whether the content type (if present) is nillable- Specified by:
isNillablein interfaceNodeTest- Returns:
- true if the content test (when present) can match nodes that are nilled
-
explainMismatch
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.- Specified by:
explainMismatchin interfaceNodeTest- Parameters:
item- the item that doesn't match this typeth- the type hierarchy cache- Returns:
- optionally, a message explaining why the item does not match the type
-
toShortString
Get a concise string representation of this node test for use in diagnostics- Specified by:
toShortStringin interfaceNodeTest- Returns:
- a suitably abbreviated respresention of the node test
-