public class XPathReader extends java.lang.Object implements XPathReader
XPathReader
which
generates callbacks to an XPathHandler
.Modifier and Type | Field and Description |
---|---|
private static XPathHandler |
defaultHandler |
private XPathHandler |
handler |
private XPathLexer |
lexer |
private java.util.ArrayList |
tokens |
Constructor and Description |
---|
XPathReader()
Create a new
XPathReader with a do-nothing
XPathHandler . |
Modifier and Type | Method and Description |
---|---|
private void |
abbrStep() |
private void |
absoluteLocationPath() |
private void |
additiveExpr() |
private void |
andExpr() |
private void |
arguments() |
private int |
axisSpecifier() |
private XPathSyntaxException |
createSyntaxException(java.lang.String message) |
private void |
equalityExpr() |
private void |
expr() |
private void |
filterExpr() |
private void |
functionCall() |
XPathHandler |
getXPathHandler()
Retrieve the current
XPathHandler
which receives the event callbacks. |
private boolean |
isNodeTypeName(Token name) |
private int |
LA(int position) |
private void |
literal() |
(package private) void |
locationPath(boolean isAbsolute) |
private Token |
LT(int position) |
private Token |
match(int tokenType) |
private void |
multiplicativeExpr() |
private void |
nameTest(int axis) |
private void |
nodeTest(int axis) |
private void |
nodeTypeTest(int axis) |
private void |
orExpr() |
void |
parse(java.lang.String xpath)
Parse an XPath expression,
and send event callbacks to an
XPathHandler . |
private void |
pathExpr() |
(package private) void |
predicate() |
private void |
predicateExpr() |
private void |
predicates() |
private void |
relationalExpr() |
private void |
relativeLocationPath() |
(package private) void |
setUpParse(java.lang.String xpath) |
void |
setXPathHandler(XPathHandler handler)
Set the
XPathHandler to receive
event callbacks during the parse. |
(package private) void |
step() |
private void |
steps() |
private void |
throwInvalidAxis(java.lang.String invalidAxis) |
private void |
unaryExpr() |
private void |
unionExpr() |
private void |
variableReference() |
private java.util.ArrayList tokens
private XPathLexer lexer
private XPathHandler handler
private static XPathHandler defaultHandler
public XPathReader()
XPathReader
with a do-nothing
XPathHandler
.public void setXPathHandler(XPathHandler handler)
SAXPathEventSource
XPathHandler
to receive
event callbacks during the parse.setXPathHandler
in interface SAXPathEventSource
handler
- the handler to receive callbackspublic XPathHandler getXPathHandler()
SAXPathEventSource
XPathHandler
which receives the event callbacks.getXPathHandler
in interface SAXPathEventSource
XPathHandler
public void parse(java.lang.String xpath) throws SAXPathException
XPathReader
XPathHandler
.parse
in interface XPathReader
xpath
- the textual XPath expression to parseSAXPathException
- if the expression is syntactically incorrectvoid setUpParse(java.lang.String xpath)
private void pathExpr() throws SAXPathException
SAXPathException
private void literal() throws SAXPathException
SAXPathException
private void functionCall() throws SAXPathException
SAXPathException
private void arguments() throws SAXPathException
SAXPathException
private void filterExpr() throws SAXPathException
SAXPathException
private void variableReference() throws SAXPathException
SAXPathException
void locationPath(boolean isAbsolute) throws SAXPathException
SAXPathException
private void absoluteLocationPath() throws SAXPathException
SAXPathException
private void relativeLocationPath() throws SAXPathException
SAXPathException
private void steps() throws SAXPathException
SAXPathException
void step() throws SAXPathException
SAXPathException
private int axisSpecifier() throws SAXPathException
SAXPathException
private void nodeTest(int axis) throws SAXPathException
SAXPathException
private void nodeTypeTest(int axis) throws SAXPathException
SAXPathException
private void nameTest(int axis) throws SAXPathException
SAXPathException
private void abbrStep() throws SAXPathException
SAXPathException
private void predicates() throws SAXPathException
SAXPathException
void predicate() throws SAXPathException
SAXPathException
private void predicateExpr() throws SAXPathException
SAXPathException
private void expr() throws SAXPathException
SAXPathException
private void orExpr() throws SAXPathException
SAXPathException
private void andExpr() throws SAXPathException
SAXPathException
private void equalityExpr() throws SAXPathException
SAXPathException
private void relationalExpr() throws SAXPathException
SAXPathException
private void additiveExpr() throws SAXPathException
SAXPathException
private void multiplicativeExpr() throws SAXPathException
SAXPathException
private void unaryExpr() throws SAXPathException
SAXPathException
private void unionExpr() throws SAXPathException
SAXPathException
private Token match(int tokenType) throws XPathSyntaxException
XPathSyntaxException
private int LA(int position)
private Token LT(int position)
private boolean isNodeTypeName(Token name)
private XPathSyntaxException createSyntaxException(java.lang.String message)
private void throwInvalidAxis(java.lang.String invalidAxis) throws SAXPathException
SAXPathException