org.jaxen.saxpath.base
Class XPathReader

java.lang.Object
  extended by org.jaxen.saxpath.base.XPathReader
All Implemented Interfaces:
TokenTypes, SAXPathEventSource, 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
private  XPathHandler handler
           
private  XPathLexer lexer
           
private  java.util.LinkedList tokens
           
 
Fields inherited from interface org.jaxen.saxpath.base.TokenTypes
AND, AT, COLON, COMMA, DIV, DOLLAR, DOT, DOT_DOT, DOUBLE, DOUBLE_COLON, DOUBLE_SLASH, EOF, EQUALS, GREATER_THAN, GREATER_THAN_EQUALS, IDENTIFIER, INTEGER, LEFT_BRACKET, LEFT_PAREN, LESS_THAN, LESS_THAN_EQUALS, LITERAL, MINUS, MOD, NOT, NOT_EQUALS, OR, PIPE, PLUS, RIGHT_BRACKET, RIGHT_PAREN, SKIP, SLASH, STAR
 
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
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