org.jaxen
Class JaxenHandler

java.lang.Object
  extended byorg.jaxen.JaxenHandler
All Implemented Interfaces:
org.saxpath.XPathHandler
Direct Known Subclasses:
PatternHandler

public class JaxenHandler
extends java.lang.Object
implements org.saxpath.XPathHandler

SAXPath XPathHandler implementation capable of building Jaxen expression trees which can walk various different object models.

Author:
bob mcwhirter (bob@werken.com)

Field Summary
protected  boolean simplified
           
protected  java.util.LinkedList stack
           
 
Constructor Summary
JaxenHandler()
          Construct.
 
Method Summary
protected  void addParameters(FunctionCallExpr function, java.util.Iterator paramIter)
           
protected  void addPredicates(Predicated obj, java.util.Iterator predIter)
           
protected  void addSteps(LocationPath locationPath, java.util.Iterator stepIter)
           
protected  boolean canPop()
           
 void endAbsoluteLocationPath()
           
 void endAdditiveExpr(int operator)
           
 void endAllNodeStep()
           
 void endAndExpr(boolean create)
           
 void endCommentNodeStep()
           
 void endEqualityExpr(int operator)
           
 void endFilterExpr()
           
 void endFunction()
           
protected  void endLocationPath()
           
 void endMultiplicativeExpr(int operator)
           
 void endNameStep()
           
 void endOrExpr(boolean create)
           
 void endPathExpr()
           
 void endPredicate()
           
 void endProcessingInstructionNodeStep()
           
 void endRelationalExpr(int operator)
           
 void endRelativeLocationPath()
           
protected  void endStep()
           
 void endTextNodeStep()
           
 void endUnaryExpr(int operator)
           
 void endUnionExpr(boolean create)
           
 void endXPath()
           
 XPathExpr getXPathExpr()
          Retrieve the simplified Jaxen XPath expression tree.
 XPathExpr getXPathExpr(boolean shouldSimplify)
          Retrieve the Jaxen XPath expression tree, optionally simplified.
 XPathFactory getXPathFactory()
          Retrieve the Jaxen XPathFactory used during the parse to construct the XPath expression tree.
 void literal(java.lang.String literal)
           
 void number(double number)
           
 void number(int number)
           
protected  java.util.LinkedList peekFrame()
           
protected  java.lang.Object pop()
           
protected  java.util.LinkedList popFrame()
           
protected  void push(java.lang.Object obj)
           
protected  void pushFrame()
           
protected  void returnExpr()
           
 void setXPathFactory(XPathFactory xpathFactory)
          Set the Jaxen XPathFactory to use during the parse to construct the XPath expression tree.
protected  int stackSize()
           
 void startAbsoluteLocationPath()
           
 void startAdditiveExpr()
           
 void startAllNodeStep(int axis)
           
 void startAndExpr()
           
 void startCommentNodeStep(int axis)
           
 void startEqualityExpr()
           
 void startFilterExpr()
           
 void startFunction(java.lang.String prefix, java.lang.String functionName)
           
 void startMultiplicativeExpr()
           
 void startNameStep(int axis, java.lang.String prefix, java.lang.String localName)
           
 void startOrExpr()
           
 void startPathExpr()
           
 void startPredicate()
           
 void startProcessingInstructionNodeStep(int axis, java.lang.String name)
           
 void startRelationalExpr()
           
 void startRelativeLocationPath()
           
 void startTextNodeStep(int axis)
           
 void startUnaryExpr()
           
 void startUnionExpr()
           
 void startXPath()
           
 void variableReference(java.lang.String prefix, java.lang.String variableName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

simplified

protected boolean simplified

stack

protected java.util.LinkedList stack
Constructor Detail

JaxenHandler

public JaxenHandler()
Construct.

Method Detail

setXPathFactory

public void setXPathFactory(XPathFactory xpathFactory)
Set the Jaxen XPathFactory to use during the parse to construct the XPath expression tree.

Parameters:
xpathFactory - The factory to use during the parse.

getXPathFactory

public XPathFactory getXPathFactory()
Retrieve the Jaxen XPathFactory used during the parse to construct the XPath expression tree.

Returns:
The XPathFactory used during the parse.

getXPathExpr

public XPathExpr getXPathExpr()
Retrieve the simplified Jaxen XPath expression tree.

This method is only valid once XPathReader.parse(...) successfully returned.

Returns:
The XPath expression tree.

getXPathExpr

public XPathExpr getXPathExpr(boolean shouldSimplify)
Retrieve the Jaxen XPath expression tree, optionally simplified.

This method is only valid once XPathReader.parse(...) successfully returned.

Returns:
The XPath expression tree.

startXPath

public void startXPath()
                throws JaxenException
Specified by:
startXPath in interface org.saxpath.XPathHandler
Throws:
JaxenException

endXPath

public void endXPath()
              throws JaxenException
Specified by:
endXPath in interface org.saxpath.XPathHandler
Throws:
JaxenException

startPathExpr

public void startPathExpr()
                   throws JaxenException
Specified by:
startPathExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endPathExpr

public void endPathExpr()
                 throws JaxenException
Specified by:
endPathExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startAbsoluteLocationPath

public void startAbsoluteLocationPath()
                               throws JaxenException
Specified by:
startAbsoluteLocationPath in interface org.saxpath.XPathHandler
Throws:
JaxenException

endAbsoluteLocationPath

public void endAbsoluteLocationPath()
                             throws JaxenException
Specified by:
endAbsoluteLocationPath in interface org.saxpath.XPathHandler
Throws:
JaxenException

startRelativeLocationPath

public void startRelativeLocationPath()
                               throws JaxenException
Specified by:
startRelativeLocationPath in interface org.saxpath.XPathHandler
Throws:
JaxenException

endRelativeLocationPath

public void endRelativeLocationPath()
                             throws JaxenException
Specified by:
endRelativeLocationPath in interface org.saxpath.XPathHandler
Throws:
JaxenException

endLocationPath

protected void endLocationPath()
                        throws JaxenException
Throws:
JaxenException

addSteps

protected void addSteps(LocationPath locationPath,
                        java.util.Iterator stepIter)

startNameStep

public void startNameStep(int axis,
                          java.lang.String prefix,
                          java.lang.String localName)
                   throws JaxenException
Specified by:
startNameStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

endNameStep

public void endNameStep()
                 throws JaxenException
Specified by:
endNameStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

startTextNodeStep

public void startTextNodeStep(int axis)
                       throws JaxenException
Specified by:
startTextNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

endTextNodeStep

public void endTextNodeStep()
                     throws JaxenException
Specified by:
endTextNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

startCommentNodeStep

public void startCommentNodeStep(int axis)
                          throws JaxenException
Specified by:
startCommentNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

endCommentNodeStep

public void endCommentNodeStep()
                        throws JaxenException
Specified by:
endCommentNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

startAllNodeStep

public void startAllNodeStep(int axis)
                      throws JaxenException
Specified by:
startAllNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

endAllNodeStep

public void endAllNodeStep()
                    throws JaxenException
Specified by:
endAllNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

startProcessingInstructionNodeStep

public void startProcessingInstructionNodeStep(int axis,
                                               java.lang.String name)
                                        throws JaxenException
Specified by:
startProcessingInstructionNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

endProcessingInstructionNodeStep

public void endProcessingInstructionNodeStep()
                                      throws JaxenException
Specified by:
endProcessingInstructionNodeStep in interface org.saxpath.XPathHandler
Throws:
JaxenException

endStep

protected void endStep()

startPredicate

public void startPredicate()
                    throws JaxenException
Specified by:
startPredicate in interface org.saxpath.XPathHandler
Throws:
JaxenException

endPredicate

public void endPredicate()
                  throws JaxenException
Specified by:
endPredicate in interface org.saxpath.XPathHandler
Throws:
JaxenException

startFilterExpr

public void startFilterExpr()
                     throws JaxenException
Specified by:
startFilterExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endFilterExpr

public void endFilterExpr()
                   throws JaxenException
Specified by:
endFilterExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

addPredicates

protected void addPredicates(Predicated obj,
                             java.util.Iterator predIter)

returnExpr

protected void returnExpr()

startOrExpr

public void startOrExpr()
                 throws JaxenException
Specified by:
startOrExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endOrExpr

public void endOrExpr(boolean create)
               throws JaxenException
Specified by:
endOrExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startAndExpr

public void startAndExpr()
                  throws JaxenException
Specified by:
startAndExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endAndExpr

public void endAndExpr(boolean create)
                throws JaxenException
Specified by:
endAndExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startEqualityExpr

public void startEqualityExpr()
                       throws JaxenException
Specified by:
startEqualityExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endEqualityExpr

public void endEqualityExpr(int operator)
                     throws JaxenException
Specified by:
endEqualityExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startRelationalExpr

public void startRelationalExpr()
                         throws JaxenException
Specified by:
startRelationalExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endRelationalExpr

public void endRelationalExpr(int operator)
                       throws JaxenException
Specified by:
endRelationalExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startAdditiveExpr

public void startAdditiveExpr()
                       throws JaxenException
Specified by:
startAdditiveExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endAdditiveExpr

public void endAdditiveExpr(int operator)
                     throws JaxenException
Specified by:
endAdditiveExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startMultiplicativeExpr

public void startMultiplicativeExpr()
                             throws JaxenException
Specified by:
startMultiplicativeExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endMultiplicativeExpr

public void endMultiplicativeExpr(int operator)
                           throws JaxenException
Specified by:
endMultiplicativeExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startUnaryExpr

public void startUnaryExpr()
                    throws JaxenException
Specified by:
startUnaryExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endUnaryExpr

public void endUnaryExpr(int operator)
                  throws JaxenException
Specified by:
endUnaryExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

startUnionExpr

public void startUnionExpr()
                    throws JaxenException
Specified by:
startUnionExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

endUnionExpr

public void endUnionExpr(boolean create)
                  throws JaxenException
Specified by:
endUnionExpr in interface org.saxpath.XPathHandler
Throws:
JaxenException

number

public void number(int number)
            throws JaxenException
Specified by:
number in interface org.saxpath.XPathHandler
Throws:
JaxenException

number

public void number(double number)
            throws JaxenException
Specified by:
number in interface org.saxpath.XPathHandler
Throws:
JaxenException

literal

public void literal(java.lang.String literal)
             throws JaxenException
Specified by:
literal in interface org.saxpath.XPathHandler
Throws:
JaxenException

variableReference

public void variableReference(java.lang.String prefix,
                              java.lang.String variableName)
                       throws JaxenException
Specified by:
variableReference in interface org.saxpath.XPathHandler
Throws:
JaxenException

startFunction

public void startFunction(java.lang.String prefix,
                          java.lang.String functionName)
                   throws JaxenException
Specified by:
startFunction in interface org.saxpath.XPathHandler
Throws:
JaxenException

endFunction

public void endFunction()
                 throws JaxenException
Specified by:
endFunction in interface org.saxpath.XPathHandler
Throws:
JaxenException

addParameters

protected void addParameters(FunctionCallExpr function,
                             java.util.Iterator paramIter)

stackSize

protected int stackSize()

push

protected void push(java.lang.Object obj)

pop

protected java.lang.Object pop()

canPop

protected boolean canPop()

pushFrame

protected void pushFrame()

popFrame

protected java.util.LinkedList popFrame()

peekFrame

protected java.util.LinkedList peekFrame()


Copyright © 2002 bob mcwhirter & James Strachan. All Rights Reserved. Hosted by

SourceForge Logo