|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--net.sf.saxon.pattern.Pattern
|
+--net.sf.saxon.pattern.NodeTest
A NodeTest is a simple kind of pattern that enables a context-free test of whether a node has a particular name. There are several kinds of node test: a full name test, a prefix test, and an "any node of a given type" test, an "any node of any type" test, a "no nodes" test (used, e.g. for "@comment()")
| Field Summary |
| Fields inherited from class net.sf.saxon.pattern.Pattern |
originalText |
| Constructor Summary | |
NodeTest()
|
|
| Method Summary | |
abstract boolean |
allowsTextNodes()
Indicate whether this NodeTest is capable of matching text nodes |
AtomicType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item of this type is atomized (assuming that atomization succeeds) |
NodeTest |
getNodeTest()
Get a NodeTest that all the nodes matching this pattern must satisfy |
int |
getPrimitiveType()
Get the primitive type corresponding to this item type. |
ItemType |
getSuperType()
Get the type from which this item type is derived by restriction. |
boolean |
isSameType(ItemType other)
Test whether this NodeTest represents the same type as another NodeTest |
abstract boolean |
matches(int nodeKind,
int fingerprint,
int annotation)
Test whether this node test is satisfied by a given node. |
boolean |
matches(NodeInfo node,
Controller controller)
Determine whether this Pattern matches the given Node. |
boolean |
matchesItem(Item item)
Test whether a given item conforms to this type |
| Methods inherited from class net.sf.saxon.pattern.Pattern |
getDefaultPriority, getFingerprint, getLineNumber, getNodeKind, getSystemId, internalMatches, make, setLineNumber, setOriginalText, setSystemId, simplify, toString, typeCheck |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.saxon.type.ItemType |
toString |
| Constructor Detail |
public NodeTest()
| Method Detail |
public boolean matchesItem(Item item)
matchesItem in interface ItemTypeitem - The item to be tested
public ItemType getSuperType()
ItemType
getSuperType in interface ItemTypepublic int getPrimitiveType()
ItemType
getPrimitiveType in interface ItemTypepublic AtomicType getAtomizedItemType()
getAtomizedItemType in interface ItemType
public abstract boolean matches(int nodeKind,
int fingerprint,
int annotation)
nodeKind - The kind of node to be matchedfingerprint - identifies the expanded name of the node to be matched.
The value should be -1 for a node with no name.annotation - The actual content type of the node
public boolean matches(NodeInfo node,
Controller controller)
matches in class Patternnode - The NodeInfo representing the Element or other node to be tested against the Patterncontroller - The context in which the match is to take place. Only relevant if the pattern
uses variables, or contains calls on functions such as document() or key().
public NodeTest getNodeTest()
getNodeTest in class Patternpublic abstract boolean allowsTextNodes()
public boolean isSameType(ItemType other)
isSameType in interface ItemTypeother -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||