Package net.sf.saxon.pattern
Class MultipleNodeKindTest
java.lang.Object
net.sf.saxon.pattern.MultipleNodeKindTest
- All Implemented Interfaces:
NodePredicate,NodeTest
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 MultipleNodeKindTeststatic final MultipleNodeKindTest -
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.booleanexplainMismatch(Item item, TypeHierarchy th) Get extra diagnostic information about why a supplied item does not conform to this item type, if available.doubleDetermine the default priority to use if this pattern 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 the correspondingUType.inthashCode()Returns a hash code value for the object.booleanDetermine 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()
-
Field Details
-
PARENT_NODE
-
PARENT_XNODE
-
DOC_ELEM_ATTR
-
LEAF
-
CHILD_NODE
-
-
Constructor Details
-
MultipleNodeKindTest
-
-
Method Details
-
getItemType
Get an item type that all matching nodes must satisfy- Specified by:
getItemTypein interfaceNodeTest- Returns:
- an item 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.- Specified by:
asXNodeTestin interfaceNodeTest
-
getUType
Get the correspondingUType. A UType is a union of primitive item types. -
getQNameTest
Description copied from interface:NodeTestExtract 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
-
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
-
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- 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
-
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 interfaceNodeTest- Returns:
- the default priority for the pattern
-
toString
-
toShortString
Description copied from interface:NodeTestGet 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
-
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
-