org.jaxen.pattern
Class PatternHandler

java.lang.Object
  |
  +--org.jaxen.JaxenHandler
        |
        +--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.

Returns:
The Pattern expression tree.

endXPath

public void endXPath()
              throws JaxenException
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
JaxenException

endPathExpr

public void endPathExpr()
                 throws JaxenException
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
JaxenException

startAbsoluteLocationPath

public void startAbsoluteLocationPath()
                               throws JaxenException
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
JaxenException

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
JaxenException

startRelativeLocationPath

public void startRelativeLocationPath()
                               throws JaxenException
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
JaxenException

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
JaxenException

endLocationPath

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

startNameStep

public void startNameStep(int axis,
                          String prefix,
                          String localName)
                   throws JaxenException
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.
JaxenException

startTextNodeStep

public void startTextNodeStep(int axis)
                       throws JaxenException
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.
JaxenException

startCommentNodeStep

public void startCommentNodeStep(int axis)
                          throws JaxenException
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.
JaxenException

startAllNodeStep

public void startAllNodeStep(int axis)
                      throws JaxenException
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.
JaxenException

startProcessingInstructionNodeStep

public void startProcessingInstructionNodeStep(int axis,
                                               String name)
                                        throws JaxenException
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, of the empty-string if none is specified.
JaxenException

endStep

protected void endStep()
Overrides:
endStep in class JaxenHandler

startUnionExpr

public void startUnionExpr()
                    throws JaxenException
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
JaxenException

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.
JaxenException

createAbsoluteLocationPath

protected Pattern createAbsoluteLocationPath()

createRelativeLocationPath

protected Pattern createRelativeLocationPath()


Copyright © 2001-2003 Codehaus. All Rights Reserved.