public class NodeTest extends Expression
| Modifier and Type | Field and Description |
|---|---|
protected String |
m_name
The local name to be tested for.
|
protected int |
m_whatToShow
This attribute determines which node types are accepted.
|
static XNumber |
SCORE_NODETEST
The match score if the pattern consists of just a NodeTest.
|
static XNumber |
SCORE_NONE
The match score if no match is made.
|
static XNumber |
SCORE_NSWILD
The match score if the pattern pattern has the form NCName:*.
|
static XNumber |
SCORE_OTHER
The match score if the pattern consists of something other than just a NodeTest or just a
qname.
|
static XNumber |
SCORE_QNAME
The match score if the pattern has the form of a QName optionally preceded by an @ character.
|
static int |
SHOW_BYFUNCTION
Special bitmap for match patterns starting with a function.
|
static String |
WILD
The namespace or local name for node tests with a wildcard.
|
| Constructor and Description |
|---|
NodeTest()
Null argument constructor.
|
NodeTest(int whatToShow)
Construct an NodeTest that doesn't test for node names.
|
NodeTest(int whatToShow,
String namespace,
String name)
Construct an NodeTest that tests for namespaces and node names.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
calcScore()
Static calc of match score.
|
void |
callVisitors(XPathVisitor visitor)
This will traverse the hierarchy, calling the visitor for each member.
|
boolean |
deepEquals(Expression expr)
Compare this object with another object and see if they are equal, include the sub heararchy.
|
XObject |
execute(XPathContext xctxt)
Execute an expression in the XPath runtime context, and return the result of the expression.
|
XObject |
execute(XPathContext xctxt,
int context)
Execute an expression in the XPath runtime context, and return the result of the expression.
|
XObject |
execute(XPathContext xctxt,
int context,
DTM dtm,
int expType)
Execute an expression in the XPath runtime context, and return the result of the expression.
|
String |
getLocalName()
Return the local name to be tested.
|
String |
getNamespace()
Return the namespace to be tested.
|
static int |
getNodeTypeTest(int whatToShow)
Tell what node type to test, if not DTMFilter.SHOW_ALL.
|
XNumber |
getStaticScore()
Get the static score for this node test.
|
int |
getWhatToShow()
This attribute determines which node types are accepted.
|
void |
initNodeTest(int whatToShow)
Initialize this node test by setting the whatToShow property, and calculating the score that
this test will return if a test succeeds.
|
void |
initNodeTest(int whatToShow,
String namespace,
String name)
Initialize this node test by setting the whatToShow property and the namespace and local name,
and calculating the score that this test will return if a test succeeds.
|
void |
setLocalName(String name)
Set the local name to be tested.
|
void |
setNamespace(String ns)
Set the namespace to be tested.
|
void |
setStaticScore(XNumber score)
Set the static score for this node test.
|
void |
setWhatToShow(int what)
This attribute determines which node types are accepted.
|
asIterator, asNode, assertion, bool, canTraverseOutsideSubtree, error, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, numpublic static final String WILD
protected int m_whatToShow
public static final int SHOW_BYFUNCTION
NodeFilter.protected String m_name
public static final XNumber SCORE_NODETEST
public static final XNumber SCORE_NSWILD
public static final XNumber SCORE_QNAME
public static final XNumber SCORE_OTHER
public static final XNumber SCORE_NONE
public NodeTest(int whatToShow,
String namespace,
String name)
whatToShow - Bit set defined mainly by NodeFilter.namespace - The namespace to be tested.name - The local name to be tested.public NodeTest(int whatToShow)
whatToShow - Bit set defined mainly by NodeFilter.public NodeTest()
public int getWhatToShow()
NodeFilter interface.NodeFilter.public void setWhatToShow(int what)
NodeFilter interface.what - bitset mainly defined in NodeFilter.public String getNamespace()
WILD, or null.public void setNamespace(String ns)
ns - The namespace to be tested for, or WILD, or null.public String getLocalName()
WILD, or an empty string.public void setLocalName(String name)
name - the local name to be tested, or WILD, or an empty string.public boolean deepEquals(Expression expr)
deepEquals in class Expressionexpr - Another expression object.public void initNodeTest(int whatToShow)
whatToShow - Bit set defined mainly by NodeFilter.public void initNodeTest(int whatToShow,
String namespace,
String name)
whatToShow - Bit set defined mainly by NodeFilter.namespace - The namespace to be tested.name - The local name to be tested.public XNumber getStaticScore()
public void setStaticScore(XNumber score)
score - Should be one of the SCORE_XXX constants.protected void calcScore()
public static int getNodeTypeTest(int whatToShow)
whatToShow - Bit set defined mainly by DTMFilter.public XObject execute(XPathContext xctxt, int context) throws TransformerException
execute in class Expressionxctxt - The XPath runtime context.context - The currentNode.XObject.TransformerException - if a runtime exception occurs.public XObject execute(XPathContext xctxt, int context, DTM dtm, int expType) throws TransformerException
execute in class Expressionxctxt - The XPath runtime context.context - The currentNode.dtm - The DTM of the current node.expType - The expanded type ID of the current node.XObject.TransformerException - if a runtime exception occurs.public XObject execute(XPathContext xctxt) throws TransformerException
execute in class Expressionxctxt - The XPath runtime context.XObject.TransformerException - if a runtime exception occurs.public void callVisitors(XPathVisitor visitor)
visitor - The visitor whose appropriate method will be called.Copyright © 2022. All rights reserved.