org.jaxen.pattern
Class PatternHandler

java.lang.Object
  extended by org.jaxen.JaxenHandler
      extended by org.jaxen.pattern.PatternHandler
All Implemented Interfaces:
XPathHandler

public class PatternHandler
extends JaxenHandler

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

Author:
bob mcwhirter (bob@werken.com)

Field Summary
 
Fields inherited from class org.jaxen.JaxenHandler
simplified, stack
 
Constructor Summary
PatternHandler()
           
 
Method Summary
protected  Pattern createAbsoluteLocationPath()
           
protected  Pattern createRelativeLocationPath()
           
 void endAbsoluteLocationPath()
          Receive notification of the end of an absolute location path expression.
protected  void endLocationPath()
           
 void endPathExpr()
          Receive notification of the end of a path expression.
 void endRelativeLocationPath()
          Receive notification of the end of a relative location path expression.
protected  void endStep()
           
 void endUnionExpr(boolean create)
          Receive notification of the end of a union ('|') expression.
 void endXPath()
          Receive notification of the end of an XPath expression parse.
 Pattern getPattern()
          Retrieve the simplified Jaxen Pattern expression tree.
 Pattern getPattern(boolean shouldSimplify)
          Retrieve the Jaxen Pattern expression tree, optionally simplified.
 void startAbsoluteLocationPath()
          Receive notification of the start of an absolute location path expression.
 void startAllNodeStep(int axis)
          Receive notification of the start of a node() step.
 void startCommentNodeStep(int axis)
          Receive notification of the start of a comment() step.
 void startNameStep(int axis, String prefix, String localName)
          Receive notification of the start of a name step.
 void startProcessingInstructionNodeStep(int axis, String name)
          Receive notification of the start of a processing-instruction(...) step.
 void startRelativeLocationPath()
          Receive notification of the start of a relative location path expression.
 void startTextNodeStep(int axis)
          Receive notification of the start of a text() step.
 void startUnionExpr()
          Receive notification of the start of a union ('|') expression.
 
Methods inherited from class org.jaxen.JaxenHandler
addParameters, addPredicates, addSteps, canPop, endAdditiveExpr, endAllNodeStep, endAndExpr, endCommentNodeStep, endEqualityExpr, endFilterExpr, endFunction, endMultiplicativeExpr, endNameStep, endOrExpr, endPredicate, endProcessingInstructionNodeStep, endRelationalExpr, endTextNodeStep, endUnaryExpr, getXPathExpr, getXPathExpr, getXPathFactory, literal, number, number, peekFrame, pop, popFrame, push, pushFrame, returnExpr, setXPathFactory, stackSize, startAdditiveExpr, startAndExpr, startEqualityExpr, startFilterExpr, startFunction, startMultiplicativeExpr, startOrExpr, startPathExpr, startPredicate, startRelationalExpr, startUnaryExpr, startXPath, variableReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternHandler

public PatternHandler()
Method Detail

getPattern

public Pattern getPattern()
Retrieve the simplified Jaxen Pattern expression tree.

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

Returns:
The Pattern expression tree.

getPattern

public Pattern getPattern(boolean shouldSimplify)
Retrieve the Jaxen Pattern expression tree, optionally simplified.

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

Parameters:
shouldSimplify - ????
Returns:
The Pattern expression tree.

endXPath

public void endXPath()
Description copied from interface: XPathHandler
Receive notification of the end of an XPath expression parse.

Specified by:
endXPath in interface XPathHandler
Overrides:
endXPath in class JaxenHandler

endPathExpr

public void endPathExpr()
Description copied from interface: XPathHandler
Receive notification of the end of a path expression.

Specified by:
endPathExpr in interface XPathHandler
Overrides:
endPathExpr in class JaxenHandler

startAbsoluteLocationPath

public void startAbsoluteLocationPath()
Description copied from interface: XPathHandler
Receive notification of the start of an absolute location path expression.

Specified by:
startAbsoluteLocationPath in interface XPathHandler
Overrides:
startAbsoluteLocationPath in class JaxenHandler

endAbsoluteLocationPath

public void endAbsoluteLocationPath()
                             throws JaxenException
Description copied from interface: XPathHandler
Receive notification of the end of an absolute location path expression.

Specified by:
endAbsoluteLocationPath in interface XPathHandler
Overrides:
endAbsoluteLocationPath in class JaxenHandler
Throws:
JaxenException

startRelativeLocationPath

public void startRelativeLocationPath()
Description copied from interface: XPathHandler
Receive notification of the start of a relative location path expression.

Specified by:
startRelativeLocationPath in interface XPathHandler
Overrides:
startRelativeLocationPath in class JaxenHandler

endRelativeLocationPath

public void endRelativeLocationPath()
                             throws JaxenException
Description copied from interface: XPathHandler
Receive notification of the end of a relative location path expression.

Specified by:
endRelativeLocationPath in interface XPathHandler
Overrides:
endRelativeLocationPath in class JaxenHandler
Throws:
JaxenException

endLocationPath

protected void endLocationPath()
                        throws JaxenException
Overrides:
endLocationPath in class JaxenHandler
Throws:
JaxenException

startNameStep

public void startNameStep(int axis,
                          String prefix,
                          String localName)
Description copied from interface: XPathHandler
Receive notification of the start of a name step.

Specified by:
startNameStep in interface XPathHandler
Overrides:
startNameStep in class JaxenHandler
Parameters:
axis - the axis of this step
prefix - the namespace prefix for the name to test, or the empty string if no prefix is specified
localName - the local part of the name to test

startTextNodeStep

public void startTextNodeStep(int axis)
Description copied from interface: XPathHandler
Receive notification of the start of a text() step.

Specified by:
startTextNodeStep in interface XPathHandler
Overrides:
startTextNodeStep in class JaxenHandler
Parameters:
axis - the axis of this step

startCommentNodeStep

public void startCommentNodeStep(int axis)
Description copied from interface: XPathHandler
Receive notification of the start of a comment() step.

Specified by:
startCommentNodeStep in interface XPathHandler
Overrides:
startCommentNodeStep in class JaxenHandler
Parameters:
axis - the axis of this step

startAllNodeStep

public void startAllNodeStep(int axis)
Description copied from interface: XPathHandler
Receive notification of the start of a node() step.

Specified by:
startAllNodeStep in interface XPathHandler
Overrides:
startAllNodeStep in class JaxenHandler
Parameters:
axis - the axis of this step

startProcessingInstructionNodeStep

public void startProcessingInstructionNodeStep(int axis,
                                               String name)
Description copied from interface: XPathHandler
Receive notification of the start of a processing-instruction(...) step.

Specified by:
startProcessingInstructionNodeStep in interface XPathHandler
Overrides:
startProcessingInstructionNodeStep in class JaxenHandler
Parameters:
axis - the axis of this step
name - the name of the processing-instruction, or the empty string if none is specified

endStep

protected void endStep()
Overrides:
endStep in class JaxenHandler

startUnionExpr

public void startUnionExpr()
Description copied from interface: XPathHandler
Receive notification of the start of a union ('|') expression.

Specified by:
startUnionExpr in interface XPathHandler
Overrides:
startUnionExpr in class JaxenHandler

endUnionExpr

public void endUnionExpr(boolean create)
                  throws JaxenException
Description copied from interface: XPathHandler
Receive notification of the end of a union ('|') expression.

Specified by:
endUnionExpr in interface XPathHandler
Overrides:
endUnionExpr in class JaxenHandler
Parameters:
create - flag that indicates if this expression should truly be instantiated, or if it was just a pass-through, based upon the grammar productions
Throws:
JaxenException

createAbsoluteLocationPath

protected Pattern createAbsoluteLocationPath()

createRelativeLocationPath

protected Pattern createRelativeLocationPath()


Copyright © 2001-2008 Codehaus. All Rights Reserved.