public class NodeTestPattern extends Pattern
Constructor and Description |
---|
NodeTestPattern(NodeTest test)
Create an NodeTestPattern that matches all items of a given type
|
Modifier and Type | Method and Description |
---|---|
Pattern |
convertToTypedPattern(String val)
Convert the pattern to a typed pattern, in which an element name is treated as
schema-element(N)
|
boolean |
equals(Object other)
Determine whether this pattern is the same as another pattern
|
int |
getFingerprint()
Determine the name fingerprint of nodes to which this pattern applies.
|
NodeTest |
getItemType()
Get a NodeTest that all the nodes matching this pattern must satisfy
|
int |
getNodeKind()
Determine the types of nodes to which this pattern applies.
|
int |
getNodeKindMask()
Get a mask indicating which kinds of nodes this NodeTest can match.
|
int |
hashCode()
Hashcode supporting equals()
|
boolean |
matches(Item item,
XPathContext context)
Determine whether this Pattern matches the given Node.
|
String |
toString()
Display the pattern for diagnostics
|
allocateSlots, analyze, bindCurrent, getColumnNumber, getConfiguration, getContainerGranularity, getDefaultPriority, getDependencies, getHostLanguage, getLineNumber, getLocationProvider, getPackageData, getPublicId, getSystemId, isMotionless, iterateSubExpressions, make, matchesBeneathAnchor, promote, replaceCurrent, replaceSubExpression, selectNodes, setLineNumber, setOriginalText, setPackageData, setPriority, setSystemId, simplify
public NodeTestPattern(NodeTest test)
test
- the type that the items must satisfy for the pattern to matchpublic boolean matches(Item item, XPathContext context)
matches
in class Pattern
item
- The NodeInfo representing the Element or other node to be tested against the Patterncontext
- 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(). Not used (and can be
set to null) in the case of patterns that are NodeTestspublic NodeTest getItemType()
getItemType
in class Pattern
public int getNodeKind()
getNodeKind
in class Pattern
public int getNodeKindMask()
getNodeKindMask
in class Pattern
public int getFingerprint()
getFingerprint
in class Pattern
public String toString()
public boolean equals(Object other)
public Pattern convertToTypedPattern(String val) throws XPathException
convertToTypedPattern
in class Pattern
val
- either "strict" or "lax" depending on the value of xsl:mode/@typedXPathException
- if the pattern cannot be convertedCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.