Package org.jaxen.saxpath.helpers
Class DefaultXPathHandler
java.lang.Object
org.jaxen.saxpath.helpers.DefaultXPathHandler
- All Implemented Interfaces:
XPathHandler
Default base class for SAXPath event handlers.
This class is available as a convenience base class for SAXPath
applications: it provides a default do-nothing implementation
for all of the callbacks in the core SAXPath handler class,
XPathHandler
.
Application writers can extend this class when they need to
implement only part of the XPathHandler
interface. Parser writers can instantiate
this class to provide default handlers when the application has not
supplied its own.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Receive notification of the end of an absolute location path expression.void
endAdditiveExpr
(int operator) Receive notification of the end of an additive ('+' or '-') expression.void
Receive notification of the end of a node() step.void
endAndExpr
(boolean create) Receive notification of the end of an 'and' expression.void
Receive notification of the end of a comment() step.void
endEqualityExpr
(int operator) Receive notification of the end of an equality ('=' or '!=') expression.void
Receive notification of the end of a filter expression.void
Receive notification of the end of a function callvoid
endMultiplicativeExpr
(int operator) Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.void
Receive notification of the end of a NameStepvoid
endOrExpr
(boolean create) Receive notification of the end of an 'or' expression.void
Receive notification of the end of a path expression.void
Receive notification of the end of a predicate.void
Receive notification of the end of a processing-instruction(...) step.void
endRelationalExpr
(int operator) Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.void
Receive notification of the end of a relative location path expression.void
Receive notification of the end of a text() step.void
endUnaryExpr
(int operator) Receive notification of the end of a unary ('+' or '-') expression.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.void
Receive notification of a literal expression.void
number
(double number) Receive notification of a number expression.void
number
(int number) Receive notification of a number expression.void
Receive notification of the start of an absolute location path expression.void
Receive notification of the start of an additive ('+' or '-') expression.void
startAllNodeStep
(int axis) Receive notification of the start of a node() step.void
Receive notification of the start of an 'and' expression.void
startCommentNodeStep
(int axis) Receive notification of the start of a comment() step.void
Receive notification of the start of an equality ('=' or '!=') expression.void
Receive notification of the start of a filter expression.void
startFunction
(String prefix, String functionName) Receive notification of a function call.void
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.void
startNameStep
(int axis, String prefix, String localName) Receive notification of the start of a name step.void
Receive notification of the start of an 'or' expression.void
Receive notification of the start of a path expression.void
Receive notification of the start of a predicate.void
startProcessingInstructionNodeStep
(int axis, String name) Receive notification of the start of a processing-instruction(...) step.void
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.void
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
Receive notification of the start of a unary ('+' or '-') expression.void
Receive notification of the start of a union ('|') expression.void
Receive notification of the start of an XPath expression parse.void
variableReference
(String prefix, String variableName) Receive notification of a variable-reference expression.
-
Constructor Details
-
DefaultXPathHandler
public DefaultXPathHandler()
-
-
Method Details
-
startXPath
Description copied from interface:XPathHandler
Receive notification of the start of an XPath expression parse.- Specified by:
startXPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
endXPath
Description copied from interface:XPathHandler
Receive notification of the end of an XPath expression parse.- Specified by:
endXPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
startPathExpr
Description copied from interface:XPathHandler
Receive notification of the start of a path expression.- Specified by:
startPathExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endPathExpr
Description copied from interface:XPathHandler
Receive notification of the end of a path expression.- Specified by:
endPathExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
startAbsoluteLocationPath
Description copied from interface:XPathHandler
Receive notification of the start of an absolute location path expression.- Specified by:
startAbsoluteLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
endAbsoluteLocationPath
Description copied from interface:XPathHandler
Receive notification of the end of an absolute location path expression.- Specified by:
endAbsoluteLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
startRelativeLocationPath
Description copied from interface:XPathHandler
Receive notification of the start of a relative location path expression.- Specified by:
startRelativeLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
endRelativeLocationPath
Description copied from interface:XPathHandler
Receive notification of the end of a relative location path expression.- Specified by:
endRelativeLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
startNameStep
Description copied from interface:XPathHandler
Receive notification of the start of a name step.- Specified by:
startNameStep
in interfaceXPathHandler
- 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- Throws:
SAXPathException
-
endNameStep
Description copied from interface:XPathHandler
Receive notification of the end of a NameStep- Specified by:
endNameStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startTextNodeStep
Description copied from interface:XPathHandler
Receive notification of the start of a text() step.- Specified by:
startTextNodeStep
in interfaceXPathHandler
- Parameters:
axis
- the axis of this step- Throws:
SAXPathException
-
endTextNodeStep
Description copied from interface:XPathHandler
Receive notification of the end of a text() step.- Specified by:
endTextNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startCommentNodeStep
Description copied from interface:XPathHandler
Receive notification of the start of a comment() step.- Specified by:
startCommentNodeStep
in interfaceXPathHandler
- Parameters:
axis
- the axis of this step- Throws:
SAXPathException
-
endCommentNodeStep
Description copied from interface:XPathHandler
Receive notification of the end of a comment() step.- Specified by:
endCommentNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startAllNodeStep
Description copied from interface:XPathHandler
Receive notification of the start of a node() step.- Specified by:
startAllNodeStep
in interfaceXPathHandler
- Parameters:
axis
- the axis of this step- Throws:
SAXPathException
-
endAllNodeStep
Description copied from interface:XPathHandler
Receive notification of the end of a node() step.- Specified by:
endAllNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startProcessingInstructionNodeStep
Description copied from interface:XPathHandler
Receive notification of the start of a processing-instruction(...) step.- Specified by:
startProcessingInstructionNodeStep
in interfaceXPathHandler
- Parameters:
axis
- the axis of this stepname
- the name of the processing-instruction, or the empty string if none is specified- Throws:
SAXPathException
-
endProcessingInstructionNodeStep
Description copied from interface:XPathHandler
Receive notification of the end of a processing-instruction(...) step.- Specified by:
endProcessingInstructionNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startPredicate
Description copied from interface:XPathHandler
Receive notification of the start of a predicate.- Specified by:
startPredicate
in interfaceXPathHandler
- Throws:
SAXPathException
-
endPredicate
Description copied from interface:XPathHandler
Receive notification of the end of a predicate.- Specified by:
endPredicate
in interfaceXPathHandler
- Throws:
SAXPathException
-
startFilterExpr
Description copied from interface:XPathHandler
Receive notification of the start of a filter expression.- Specified by:
startFilterExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endFilterExpr
Description copied from interface:XPathHandler
Receive notification of the end of a filter expression.- Specified by:
endFilterExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
startOrExpr
Description copied from interface:XPathHandler
Receive notification of the start of an 'or' expression.- Specified by:
startOrExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endOrExpr
Description copied from interface:XPathHandler
Receive notification of the end of an 'or' expression.- Specified by:
endOrExpr
in interfaceXPathHandler
- 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:
SAXPathException
-
startAndExpr
Description copied from interface:XPathHandler
Receive notification of the start of an 'and' expression.- Specified by:
startAndExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endAndExpr
Description copied from interface:XPathHandler
Receive notification of the end of an 'and' expression.- Specified by:
endAndExpr
in interfaceXPathHandler
- 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:
SAXPathException
-
startEqualityExpr
Description copied from interface:XPathHandler
Receive notification of the start of an equality ('=' or '!=') expression.- Specified by:
startEqualityExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endEqualityExpr
Description copied from interface:XPathHandler
Receive notification of the end of an equality ('=' or '!=') expression.- Specified by:
endEqualityExpr
in interfaceXPathHandler
- Parameters:
operator
- the operator specific to this particular equality expression. If null, this expression is only a pass-through, and should not actually be instantiated.- Throws:
SAXPathException
-
startRelationalExpr
Description copied from interface:XPathHandler
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.- Specified by:
startRelationalExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endRelationalExpr
Description copied from interface:XPathHandler
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.- Specified by:
endRelationalExpr
in interfaceXPathHandler
- Parameters:
operator
- the operator specific to this particular relational expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated.- Throws:
SAXPathException
-
startAdditiveExpr
Description copied from interface:XPathHandler
Receive notification of the start of an additive ('+' or '-') expression.- Specified by:
startAdditiveExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endAdditiveExpr
Description copied from interface:XPathHandler
Receive notification of the end of an additive ('+' or '-') expression.- Specified by:
endAdditiveExpr
in interfaceXPathHandler
- Parameters:
operator
- the operator specific to this particular additive expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated.- Throws:
SAXPathException
-
startMultiplicativeExpr
Description copied from interface:XPathHandler
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.- Specified by:
startMultiplicativeExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endMultiplicativeExpr
Description copied from interface:XPathHandler
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.- Specified by:
endMultiplicativeExpr
in interfaceXPathHandler
- Parameters:
operator
- the operator specific to this particular multiplicative expression. If null, this expression is only a pass-through, and should not actually be instantiated.- Throws:
SAXPathException
-
startUnaryExpr
Description copied from interface:XPathHandler
Receive notification of the start of a unary ('+' or '-') expression.- Specified by:
startUnaryExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endUnaryExpr
Description copied from interface:XPathHandler
Receive notification of the end of a unary ('+' or '-') expression.- Specified by:
endUnaryExpr
in interfaceXPathHandler
- Parameters:
operator
- the operator specific to this particular unary expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated. If notOperator.NO_OP
, it will always beOperator.NEGATIVE
.- Throws:
SAXPathException
-
startUnionExpr
Description copied from interface:XPathHandler
Receive notification of the start of a union ('|') expression.- Specified by:
startUnionExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endUnionExpr
Description copied from interface:XPathHandler
Receive notification of the end of a union ('|') expression.- Specified by:
endUnionExpr
in interfaceXPathHandler
- 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:
SAXPathException
-
number
Description copied from interface:XPathHandler
Receive notification of a number expression.- Specified by:
number
in interfaceXPathHandler
- Parameters:
number
- the number value- Throws:
SAXPathException
-
number
Description copied from interface:XPathHandler
Receive notification of a number expression.- Specified by:
number
in interfaceXPathHandler
- Parameters:
number
- the number value- Throws:
SAXPathException
-
literal
Description copied from interface:XPathHandler
Receive notification of a literal expression.- Specified by:
literal
in interfaceXPathHandler
- Parameters:
literal
- the string literal value- Throws:
SAXPathException
-
variableReference
Description copied from interface:XPathHandler
Receive notification of a variable-reference expression.- Specified by:
variableReference
in interfaceXPathHandler
- Parameters:
prefix
- the namespace prefix of the variablevariableName
- the local name of the variable- Throws:
SAXPathException
-
startFunction
Description copied from interface:XPathHandler
Receive notification of a function call.- Specified by:
startFunction
in interfaceXPathHandler
- Parameters:
prefix
- the namespace prefix of the functionfunctionName
- the local name of the function- Throws:
SAXPathException
-
endFunction
Description copied from interface:XPathHandler
Receive notification of the end of a function call- Specified by:
endFunction
in interfaceXPathHandler
- Throws:
SAXPathException
-