Class PatternHandler
java.lang.Object
org.jaxen.JaxenHandler
org.jaxen.pattern.PatternHandler
- All Implemented Interfaces:
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
Fields inherited from class JaxenHandler
simplified, stack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Patternprotected PatternvoidReceive notification of the end of an absolute location path expression.protected voidvoidReceive notification of the end of a path expression.voidReceive 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.Retrieve the simplified Jaxen Pattern expression tree.getPattern(boolean shouldSimplify) Retrieve the Jaxen Pattern expression tree, optionally simplified.voidReceive 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, String prefix, String localName) Receive notification of the start of a name step.voidstartProcessingInstructionNodeStep(int axis, String name) Receive notification of the start of a processing-instruction(...) step.voidReceive notification of the start of a relative location path expression.voidstartTextNodeStep(int axis) Receive notification of the start of a text() step.voidReceive notification of the start of a union ('|') expression.Methods inherited from class 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
-
Constructor Details
-
PatternHandler
public PatternHandler()
-
-
Method Details
-
getPattern
Retrieve the simplified Jaxen Pattern expression tree.This method is only valid once
XPathReader.parse(...)successfully returned.- Returns:
- the Pattern expression tree
-
getPattern
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
Description 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
Description copied from interface:XPathHandlerReceive notification of the end of a relative location path expression.- Specified by:
endRelativeLocationPathin interfaceXPathHandler- Overrides:
endRelativeLocationPathin classJaxenHandler- Throws:
JaxenException
-
endLocationPath
- Overrides:
endLocationPathin classJaxenHandler- Throws:
JaxenException
-
startNameStep
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
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
Description 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
-
createRelativeLocationPath
-