Package org.jaxen.pattern
Class PatternHandler
- java.lang.Object
-
- org.jaxen.JaxenHandler
-
- org.jaxen.pattern.PatternHandler
-
- All Implemented Interfaces:
XPathHandler
public class PatternHandler extends JaxenHandler
SAXPathXPathHandlerimplementation 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
Constructors Constructor Description PatternHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PatterncreateAbsoluteLocationPath()protected PatterncreateRelativeLocationPath()voidendAbsoluteLocationPath()Receive notification of the end of an absolute location path expression.protected voidendLocationPath()voidendPathExpr()Receive notification of the end of a path expression.voidendRelativeLocationPath()Receive notification of the end of a relative location path expression.protected voidendStep()voidendUnionExpr(boolean create)Receive notification of the end of a union ('|') expression.voidendXPath()Receive notification of the end of an XPath expression parse.PatterngetPattern()Retrieve the simplified Jaxen Pattern expression tree.PatterngetPattern(boolean shouldSimplify)Retrieve the Jaxen Pattern expression tree, optionally simplified.voidstartAbsoluteLocationPath()Receive notification of the start of an absolute location path expression.voidstartAllNodeStep(int axis)Receive notification of the start of a node() step.voidstartCommentNodeStep(int axis)Receive notification of the start of a comment() step.voidstartNameStep(int axis, java.lang.String prefix, java.lang.String localName)Receive notification of the start of a name step.voidstartProcessingInstructionNodeStep(int axis, java.lang.String name)Receive notification of the start of a processing-instruction(...) step.voidstartRelativeLocationPath()Receive notification of the start of a relative location path expression.voidstartTextNodeStep(int axis)Receive notification of the start of a text() step.voidstartUnionExpr()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
-
-
-
-
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:XPathHandlerReceive notification of the end of an XPath expression parse.- Specified by:
endXPathin interfaceXPathHandler- Overrides:
endXPathin classJaxenHandler
-
endPathExpr
public void endPathExpr()
Description copied from interface:XPathHandlerReceive notification of the end of a path expression.- Specified by:
endPathExprin interfaceXPathHandler- Overrides:
endPathExprin classJaxenHandler
-
startAbsoluteLocationPath
public void startAbsoluteLocationPath()
Description copied from interface:XPathHandlerReceive notification of the start of an absolute location path expression.- Specified by:
startAbsoluteLocationPathin interfaceXPathHandler- Overrides:
startAbsoluteLocationPathin classJaxenHandler
-
endAbsoluteLocationPath
public void endAbsoluteLocationPath() throws JaxenExceptionDescription copied from interface:XPathHandlerReceive notification of the end of an absolute location path expression.- Specified by:
endAbsoluteLocationPathin interfaceXPathHandler- Overrides:
endAbsoluteLocationPathin classJaxenHandler- Throws:
JaxenException
-
startRelativeLocationPath
public void startRelativeLocationPath()
Description copied from interface:XPathHandlerReceive notification of the start of a relative location path expression.- Specified by:
startRelativeLocationPathin interfaceXPathHandler- Overrides:
startRelativeLocationPathin classJaxenHandler
-
endRelativeLocationPath
public void endRelativeLocationPath() throws JaxenExceptionDescription copied from interface:XPathHandlerReceive notification of the end of a relative location path expression.- Specified by:
endRelativeLocationPathin interfaceXPathHandler- Overrides:
endRelativeLocationPathin classJaxenHandler- Throws:
JaxenException
-
endLocationPath
protected void endLocationPath() throws JaxenException- Overrides:
endLocationPathin classJaxenHandler- Throws:
JaxenException
-
startNameStep
public void startNameStep(int axis, java.lang.String prefix, java.lang.String localName)Description copied from interface:XPathHandlerReceive notification of the start of a name step.- Specified by:
startNameStepin interfaceXPathHandler- Overrides:
startNameStepin classJaxenHandler- Parameters:
axis- the axis of this stepprefix- the namespace prefix for the name to test, or the empty string if no prefix is specifiedlocalName- the local part of the name to test
-
startTextNodeStep
public void startTextNodeStep(int axis)
Description copied from interface:XPathHandlerReceive notification of the start of a text() step.- Specified by:
startTextNodeStepin interfaceXPathHandler- Overrides:
startTextNodeStepin classJaxenHandler- Parameters:
axis- the axis of this step
-
startCommentNodeStep
public void startCommentNodeStep(int axis)
Description copied from interface:XPathHandlerReceive notification of the start of a comment() step.- Specified by:
startCommentNodeStepin interfaceXPathHandler- Overrides:
startCommentNodeStepin classJaxenHandler- Parameters:
axis- the axis of this step
-
startAllNodeStep
public void startAllNodeStep(int axis)
Description copied from interface:XPathHandlerReceive notification of the start of a node() step.- Specified by:
startAllNodeStepin interfaceXPathHandler- Overrides:
startAllNodeStepin classJaxenHandler- Parameters:
axis- the axis of this step
-
startProcessingInstructionNodeStep
public void startProcessingInstructionNodeStep(int axis, java.lang.String name)Description copied from interface:XPathHandlerReceive notification of the start of a processing-instruction(...) step.- Specified by:
startProcessingInstructionNodeStepin interfaceXPathHandler- Overrides:
startProcessingInstructionNodeStepin classJaxenHandler- Parameters:
axis- the axis of this stepname- the name of the processing-instruction, or the empty string if none is specified
-
endStep
protected void endStep()
- Overrides:
endStepin classJaxenHandler
-
startUnionExpr
public void startUnionExpr()
Description copied from interface:XPathHandlerReceive notification of the start of a union ('|') expression.- Specified by:
startUnionExprin interfaceXPathHandler- Overrides:
startUnionExprin classJaxenHandler
-
endUnionExpr
public void endUnionExpr(boolean create) throws JaxenExceptionDescription copied from interface:XPathHandlerReceive notification of the end of a union ('|') expression.- Specified by:
endUnionExprin interfaceXPathHandler- Overrides:
endUnionExprin classJaxenHandler- 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()
-
-