|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xpath.Expression | +--org.apache.xpath.patterns.NodeTest
**For advanced use only** This is the basic node test class for both match patterns and location path steps.
Field Summary | |
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 int |
SHOW_NAMESPACE
This bit specifies a namespace, and extends the SHOW_XXX stuff in NodeFilter . |
static java.lang.String |
SUPPORTS_PRE_STRIPPING
The URL to pass to the Node#supports method, to see if the DOM has already been stripped of whitespace nodes. |
static java.lang.String |
WILD
The namespace or local name for node tests with a wildcard. |
Constructor Summary | |
NodeTest()
Null argument constructor. |
|
NodeTest(int whatToShow)
Construct an NodeTest that doesn't test for node names. |
|
NodeTest(int whatToShow,
java.lang.String namespace,
java.lang.String name)
Construct an NodeTest that tests for namespaces and node names. |
Method Summary | |
static void |
debugWhatToShow(int whatToShow)
Do a diagnostics dump of a whatToShow bit set. |
XObject |
execute(XPathContext xctxt)
Test the current node to see if it matches the given node test. |
XObject |
execute(XPathContext xctxt,
Node context)
Tell what the test score is for the given node. |
double |
getDefaultScore()
Get the score that this test will return if a test succeeds. |
java.lang.String |
getLocalName()
Return the local namespace to be tested. |
java.lang.String |
getNamespace()
Return the namespace to be tested. |
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,
java.lang.String namespace,
java.lang.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. |
Methods inherited from class org.apache.xpath.Expression |
assert,
canTraverseOutsideSubtree,
error,
setSourceLocator,
warn |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String WILD
public static final java.lang.String SUPPORTS_PRE_STRIPPING
public static final int SHOW_NAMESPACE
NodeFilter
.public static final int SHOW_BYFUNCTION
NodeFilter
.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
Constructor Detail |
public NodeTest(int whatToShow, java.lang.String namespace, java.lang.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()
Method Detail |
public int getWhatToShow()
NodeFilter
interface.NodeFilter
.public java.lang.String getNamespace()
WILD
, or null.public java.lang.String getLocalName()
WILD
, or null.public void initNodeTest(int whatToShow)
whatToShow
- Bit set defined mainly by NodeFilter
.public void initNodeTest(int whatToShow, java.lang.String namespace, java.lang.String name)
whatToShow
- Bit set defined mainly by NodeFilter
.namespace
- The namespace to be tested.name
- The local name to be tested.public double getDefaultScore()
public static void debugWhatToShow(int whatToShow)
whatToShow
- Bit set defined mainly by NodeFilter
.public XObject execute(XPathContext xctxt, Node context) throws TransformerException
xctxt
- XPath runtime context.context
- The node being tested.SCORE_NODETEST
,
SCORE_NONE
,
SCORE_NSWILD
,
SCORE_QNAME
, or
SCORE_OTHER
.public XObject execute(XPathContext xctxt) throws TransformerException
xctxt
- XPath runtime context.SCORE_NODETEST
,
SCORE_NONE
,
SCORE_NSWILD
,
SCORE_QNAME
, or
SCORE_OTHER
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |