org.jaxen.saxpath.base

Class XPathReader

Implemented Interfaces:
SAXPathEventSource, XPathReader

public class XPathReader
extends java.lang.Object
implements XPathReader

Implementation of SAXPath's XPathReader which generates callbacks to an XPathHandler.
Author:
bob mcwhirter (bob@werken.com)

Field Summary

private static XPathHandler
defaultHandler
private XPathHandler
handler
private XPathLexer
lexer
private ArrayList
tokens

Constructor Summary

XPathReader()
Create a new XPathReader with a do-nothing XPathHandler.

Method Summary

private int
LA(int position)
private Token
LT(int position)
private void
abbrStep()
private void
absoluteLocationPath()
private void
additiveExpr()
private void
andExpr()
private void
arguments()
private int
axisSpecifier()
private XPathSyntaxException
createSyntaxException(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 void
literal()
(package private) void
locationPath(boolean isAbsolute)
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(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(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(String invalidAxis)
private void
unaryExpr()
private void
unionExpr()
private void
variableReference()

Field Details

defaultHandler

private static XPathHandler defaultHandler

handler

private XPathHandler handler

lexer

private XPathLexer lexer

tokens

private ArrayList tokens

Constructor Details

XPathReader

public XPathReader()
Create a new XPathReader with a do-nothing XPathHandler.

Method Details

LA

private int LA(int position)

LT

private Token LT(int position)

abbrStep

private void abbrStep()
            throws SAXPathException

absoluteLocationPath

private void absoluteLocationPath()
            throws SAXPathException

additiveExpr

private void additiveExpr()
            throws SAXPathException

andExpr

private void andExpr()
            throws SAXPathException

arguments

private void arguments()
            throws SAXPathException

axisSpecifier

private int axisSpecifier()
            throws SAXPathException

createSyntaxException

private XPathSyntaxException createSyntaxException(String message)

equalityExpr

private void equalityExpr()
            throws SAXPathException

expr

private void expr()
            throws SAXPathException

filterExpr

private void filterExpr()
            throws SAXPathException

functionCall

private void functionCall()
            throws SAXPathException

getXPathHandler

public XPathHandler getXPathHandler()
Retrieve the current XPathHandler which receives the event callbacks.
Specified by:
getXPathHandler in interface SAXPathEventSource
Returns:
the currently installed XPathHandler

isNodeTypeName

private boolean isNodeTypeName(Token name)

literal

private void literal()
            throws SAXPathException

locationPath

(package private)  void locationPath(boolean isAbsolute)
            throws SAXPathException

match

private Token match(int tokenType)
            throws XPathSyntaxException

multiplicativeExpr

private void multiplicativeExpr()
            throws SAXPathException

nameTest

private void nameTest(int axis)
            throws SAXPathException

nodeTest

private void nodeTest(int axis)
            throws SAXPathException

nodeTypeTest

private void nodeTypeTest(int axis)
            throws SAXPathException

orExpr

private void orExpr()
            throws SAXPathException

parse

public void parse(String xpath)
            throws SAXPathException
Parse an XPath expression, and send event callbacks to an XPathHandler.
Specified by:
parse in interface XPathReader
Parameters:
xpath - the textual XPath expression to parse
Throws:
SAXPathException - if the expression is syntactically incorrect

pathExpr

private void pathExpr()
            throws SAXPathException

predicate

(package private)  void predicate()
            throws SAXPathException

predicateExpr

private void predicateExpr()
            throws SAXPathException

predicates

private void predicates()
            throws SAXPathException

relationalExpr

private void relationalExpr()
            throws SAXPathException

relativeLocationPath

private void relativeLocationPath()
            throws SAXPathException

setUpParse

(package private)  void setUpParse(String xpath)

setXPathHandler

public void setXPathHandler(XPathHandler handler)
Set the XPathHandler to receive event callbacks during the parse.
Specified by:
setXPathHandler in interface SAXPathEventSource
Parameters:
handler - the handler to receive callbacks

step

(package private)  void step()
            throws SAXPathException

steps

private void steps()
            throws SAXPathException

throwInvalidAxis

private void throwInvalidAxis(String invalidAxis)
            throws SAXPathException

unaryExpr

private void unaryExpr()
            throws SAXPathException

unionExpr

private void unionExpr()
            throws SAXPathException

variableReference

private void variableReference()
            throws SAXPathException