org.jaxen.saxpath.base
Class XPathReader

java.lang.Object
  extended byorg.jaxen.saxpath.base.XPathReader
All Implemented Interfaces:
SAXPathEventSource, TokenTypes, XPathReader

public class XPathReader
extends java.lang.Object
implements XPathReader, TokenTypes

Implementation of SAXPath's XPathReader which generates callbacks to an XPathHandler.

Author:
bob mcwhirter (bob@werken.com)

Field Summary
static int AND
           
static int AT
           
static int COLON
           
static int COMMA
           
static int DIV
           
static int DOLLAR
           
static int DOT
           
static int DOT_DOT
           
static int DOUBLE
           
static int DOUBLE_COLON
           
static int DOUBLE_SLASH
           
static int EOF
           
static int EQUALS
           
static int GREATER_THAN
           
static int GREATER_THAN_EQUALS
           
private  XPathHandler handler
           
static int IDENTIFIER
           
static int INTEGER
           
static int LEFT_BRACKET
           
static int LEFT_PAREN
           
static int LESS_THAN
           
static int LESS_THAN_EQUALS
           
private  XPathLexer lexer
           
static int LITERAL
           
static int MINUS
           
static int MOD
           
static int NOT
           
static int NOT_EQUALS
           
static int OR
           
static int PIPE
           
static int PLUS
           
static int RIGHT_BRACKET
           
static int RIGHT_PAREN
           
static int SKIP
           
static int SLASH
           
static int STAR
           
private  java.util.LinkedList tokens
           
 
Constructor Summary
XPathReader()
           
 
Method Summary
(package private)  void abbrStep()
           
(package private)  void absoluteLocationPath()
           
(package private)  void additiveExpr()
           
(package private)  void andExpr()
           
(package private)  void arguments()
           
(package private)  int axisSpecifier()
           
(package private)  void equalityExpr()
           
(package private)  void expr()
           
(package private)  void filterExpr()
           
(package private)  void functionCall()
           
 XPathHandler getXPathHandler()
          Retrieve the current XPathHandler which receives the event callbacks.
(package private)  boolean isNodeTypeName(Token name)
           
(package private)  int LA(int position)
           
(package private)  void literal()
           
(package private)  void locationPath(boolean isAbsolute)
           
(package private)  Token LT(int position)
           
(package private)  Token match(int tokenType)
           
(package private)  void multiplicativeExpr()
           
(package private)  void nameTest(int axis)
           
(package private)  void nodeTest(int axis)
           
(package private)  void nodeTypeTest(int axis)
           
(package private)  void numberDouble()
           
(package private)  void numberInteger()
           
(package private)  void orExpr()
           
 void parse(java.lang.String xpath)
          Perform parsing of the textual XPath expression, and produce event callbacks to an XPathHandler.
(package private)  void pathExpr()
           
(package private)  void predicate()
           
(package private)  void predicateExpr()
           
(package private)  void predicates()
           
(package private)  void relationalExpr()
           
(package 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(boolean first)
           
(package private)  void steps()
           
(package private)  void throwInvalidAxis(java.lang.String invalidAxis)
           
(package private)  void throwSyntaxException(java.lang.String message)
           
(package private)  void throwUnexpected()
           
(package private)  void unaryExpr()
           
(package private)  void unionExpr()
           
(package private)  void variableReference()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokens

private java.util.LinkedList tokens

lexer

private XPathLexer lexer

handler

private XPathHandler handler

LEFT_PAREN

public static final int LEFT_PAREN
See Also:
Constant Field Values

RIGHT_PAREN

public static final int RIGHT_PAREN
See Also:
Constant Field Values

LEFT_BRACKET

public static final int LEFT_BRACKET
See Also:
Constant Field Values

RIGHT_BRACKET

public static final int RIGHT_BRACKET
See Also:
Constant Field Values

PLUS

public static final int PLUS
See Also:
Constant Field Values

MINUS

public static final int MINUS
See Also:
Constant Field Values

LESS_THAN

public static final int LESS_THAN
See Also:
Constant Field Values

LESS_THAN_EQUALS

public static final int LESS_THAN_EQUALS
See Also:
Constant Field Values

GREATER_THAN

public static final int GREATER_THAN
See Also:
Constant Field Values

GREATER_THAN_EQUALS

public static final int GREATER_THAN_EQUALS
See Also:
Constant Field Values

SLASH

public static final int SLASH
See Also:
Constant Field Values

DOUBLE_SLASH

public static final int DOUBLE_SLASH
See Also:
Constant Field Values

DOT

public static final int DOT
See Also:
Constant Field Values

DOT_DOT

public static final int DOT_DOT
See Also:
Constant Field Values

IDENTIFIER

public static final int IDENTIFIER
See Also:
Constant Field Values

AT

public static final int AT
See Also:
Constant Field Values

PIPE

public static final int PIPE
See Also:
Constant Field Values

COLON

public static final int COLON
See Also:
Constant Field Values

DOUBLE_COLON

public static final int DOUBLE_COLON
See Also:
Constant Field Values

STAR

public static final int STAR
See Also:
Constant Field Values

EQUALS

public static final int EQUALS
See Also:
Constant Field Values

NOT_EQUALS

public static final int NOT_EQUALS
See Also:
Constant Field Values

NOT

public static final int NOT
See Also:
Constant Field Values

DIV

public static final int DIV
See Also:
Constant Field Values

MOD

public static final int MOD
See Also:
Constant Field Values

DOLLAR

public static final int DOLLAR
See Also:
Constant Field Values

LITERAL

public static final int LITERAL
See Also:
Constant Field Values

AND

public static final int AND
See Also:
Constant Field Values

OR

public static final int OR
See Also:
Constant Field Values

INTEGER

public static final int INTEGER
See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
See Also:
Constant Field Values

COMMA

public static final int COMMA
See Also:
Constant Field Values

SKIP

public static final int SKIP
See Also:
Constant Field Values

EOF

public static final int EOF
See Also:
Constant Field Values
Constructor Detail

XPathReader

public XPathReader()
Method Detail

setXPathHandler

public void setXPathHandler(XPathHandler handler)
Description copied from interface: SAXPathEventSource
Set the XPathHandler to receive event callbacks during the parse.

Specified by:
setXPathHandler in interface SAXPathEventSource
Parameters:
handler - The handler to receive callbacks.

getXPathHandler

public XPathHandler getXPathHandler()
Description copied from interface: SAXPathEventSource
Retrieve the current XPathHandler which receives the event callbacks.

Specified by:
getXPathHandler in interface SAXPathEventSource
Returns:
The currently installed XPathHandler.

parse

public void parse(java.lang.String xpath)
           throws SAXPathException
Description copied from interface: XPathReader
Perform parsing of the textual XPath expression, and produce event callbacks to an XPathHandler.

Specified by:
parse in interface XPathReader
Parameters:
xpath - The textual XPath expression to parse.
Throws:
SAXPathException - In the event an error occurs.

setUpParse

void setUpParse(java.lang.String xpath)

pathExpr

void pathExpr()
        throws SAXPathException
Throws:
SAXPathException

numberDouble

void numberDouble()
            throws SAXPathException
Throws:
SAXPathException

numberInteger

void numberInteger()
             throws SAXPathException
Throws:
SAXPathException

literal

void literal()
       throws SAXPathException
Throws:
SAXPathException

functionCall

void functionCall()
            throws SAXPathException
Throws:
SAXPathException

arguments

void arguments()
         throws SAXPathException
Throws:
SAXPathException

filterExpr

void filterExpr()
          throws SAXPathException
Throws:
SAXPathException

variableReference

void variableReference()
                 throws SAXPathException
Throws:
SAXPathException

locationPath

void locationPath(boolean isAbsolute)
            throws SAXPathException
Throws:
SAXPathException

absoluteLocationPath

void absoluteLocationPath()
                    throws SAXPathException
Throws:
SAXPathException

relativeLocationPath

void relativeLocationPath()
                    throws SAXPathException
Throws:
SAXPathException

steps

void steps()
     throws SAXPathException
Throws:
SAXPathException

step

void step(boolean first)
    throws SAXPathException
Throws:
SAXPathException

axisSpecifier

int axisSpecifier()
            throws SAXPathException
Throws:
SAXPathException

nodeTest

void nodeTest(int axis)
        throws SAXPathException
Throws:
SAXPathException

nodeTypeTest

void nodeTypeTest(int axis)
            throws SAXPathException
Throws:
SAXPathException

nameTest

void nameTest(int axis)
        throws SAXPathException
Throws:
SAXPathException

abbrStep

void abbrStep()
        throws SAXPathException
Throws:
SAXPathException

predicates

void predicates()
          throws SAXPathException
Throws:
SAXPathException

predicate

void predicate()
         throws SAXPathException
Throws:
SAXPathException

predicateExpr

void predicateExpr()
             throws SAXPathException
Throws:
SAXPathException

expr

void expr()
    throws SAXPathException
Throws:
SAXPathException

orExpr

void orExpr()
      throws SAXPathException
Throws:
SAXPathException

andExpr

void andExpr()
       throws SAXPathException
Throws:
SAXPathException

equalityExpr

void equalityExpr()
            throws SAXPathException
Throws:
SAXPathException

relationalExpr

void relationalExpr()
              throws SAXPathException
Throws:
SAXPathException

additiveExpr

void additiveExpr()
            throws SAXPathException
Throws:
SAXPathException

multiplicativeExpr

void multiplicativeExpr()
                  throws SAXPathException
Throws:
SAXPathException

unaryExpr

void unaryExpr()
         throws SAXPathException
Throws:
SAXPathException

unionExpr

void unionExpr()
         throws SAXPathException
Throws:
SAXPathException

match

Token match(int tokenType)

LA

int LA(int position)

LT

Token LT(int position)

isNodeTypeName

boolean isNodeTypeName(Token name)

throwSyntaxException

void throwSyntaxException(java.lang.String message)
                    throws SAXPathException
Throws:
SAXPathException

throwInvalidAxis

void throwInvalidAxis(java.lang.String invalidAxis)
                throws SAXPathException
Throws:
SAXPathException

throwUnexpected

void throwUnexpected()
               throws SAXPathException
Throws:
SAXPathException