Package org.jaxen.saxpath.helpers
Class DefaultXPathHandler
- java.lang.Object
-
- org.jaxen.saxpath.helpers.DefaultXPathHandler
-
- All Implemented Interfaces:
XPathHandler
public class DefaultXPathHandler extends java.lang.Object implements 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 theXPathHandler
interface. Parser writers can instantiate this class to provide default handlers when the application has not supplied its own.
-
-
Constructor Summary
Constructors Constructor Description DefaultXPathHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endAbsoluteLocationPath()
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
endAllNodeStep()
Receive notification of the end of a node() step.void
endAndExpr(boolean create)
Receive notification of the end of an 'and' expression.void
endCommentNodeStep()
Receive notification of the end of a comment() step.void
endEqualityExpr(int operator)
Receive notification of the end of an equality ('=' or '!=') expression.void
endFilterExpr()
Receive notification of the end of a filter expression.void
endFunction()
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
endNameStep()
Receive notification of the end of a NameStepvoid
endOrExpr(boolean create)
Receive notification of the end of an 'or' expression.void
endPathExpr()
Receive notification of the end of a path expression.void
endPredicate()
Receive notification of the end of a predicate.void
endProcessingInstructionNodeStep()
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
endRelativeLocationPath()
Receive notification of the end of a relative location path expression.void
endTextNodeStep()
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
literal(java.lang.String literal)
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
startAbsoluteLocationPath()
Receive notification of the start of an absolute location path expression.void
startAdditiveExpr()
Receive notification of the start of an additive ('+' or '-') expression.void
startAllNodeStep(int axis)
Receive notification of the start of a node() step.void
startAndExpr()
Receive notification of the start of an 'and' expression.void
startCommentNodeStep(int axis)
Receive notification of the start of a comment() step.void
startEqualityExpr()
Receive notification of the start of an equality ('=' or '!=') expression.void
startFilterExpr()
Receive notification of the start of a filter expression.void
startFunction(java.lang.String prefix, java.lang.String functionName)
Receive notification of a function call.void
startMultiplicativeExpr()
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.void
startNameStep(int axis, java.lang.String prefix, java.lang.String localName)
Receive notification of the start of a name step.void
startOrExpr()
Receive notification of the start of an 'or' expression.void
startPathExpr()
Receive notification of the start of a path expression.void
startPredicate()
Receive notification of the start of a predicate.void
startProcessingInstructionNodeStep(int axis, java.lang.String name)
Receive notification of the start of a processing-instruction(...) step.void
startRelationalExpr()
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.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
startUnaryExpr()
Receive notification of the start of a unary ('+' or '-') expression.void
startUnionExpr()
Receive notification of the start of a union ('|') expression.void
startXPath()
Receive notification of the start of an XPath expression parse.void
variableReference(java.lang.String prefix, java.lang.String variableName)
Receive notification of a variable-reference expression.
-
-
-
Method Detail
-
startXPath
public void startXPath() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of an XPath expression parse.- Specified by:
startXPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
endXPath
public void endXPath() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of an XPath expression parse.- Specified by:
endXPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
startPathExpr
public void startPathExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of a path expression.- Specified by:
startPathExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endPathExpr
public void endPathExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a path expression.- Specified by:
endPathExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
startAbsoluteLocationPath
public void startAbsoluteLocationPath() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of an absolute location path expression.- Specified by:
startAbsoluteLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
endAbsoluteLocationPath
public void endAbsoluteLocationPath() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of an absolute location path expression.- Specified by:
endAbsoluteLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
startRelativeLocationPath
public void startRelativeLocationPath() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of a relative location path expression.- Specified by:
startRelativeLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
endRelativeLocationPath
public void endRelativeLocationPath() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a relative location path expression.- Specified by:
endRelativeLocationPath
in interfaceXPathHandler
- Throws:
SAXPathException
-
startNameStep
public void startNameStep(int axis, java.lang.String prefix, java.lang.String localName) throws SAXPathException
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
public void endNameStep() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a NameStep- Specified by:
endNameStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startTextNodeStep
public void startTextNodeStep(int axis) throws SAXPathException
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
public void endTextNodeStep() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a text() step.- Specified by:
endTextNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startCommentNodeStep
public void startCommentNodeStep(int axis) throws SAXPathException
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
public void endCommentNodeStep() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a comment() step.- Specified by:
endCommentNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startAllNodeStep
public void startAllNodeStep(int axis) throws SAXPathException
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
public void endAllNodeStep() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a node() step.- Specified by:
endAllNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startProcessingInstructionNodeStep
public void startProcessingInstructionNodeStep(int axis, java.lang.String name) throws SAXPathException
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
public void endProcessingInstructionNodeStep() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a processing-instruction(...) step.- Specified by:
endProcessingInstructionNodeStep
in interfaceXPathHandler
- Throws:
SAXPathException
-
startPredicate
public void startPredicate() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of a predicate.- Specified by:
startPredicate
in interfaceXPathHandler
- Throws:
SAXPathException
-
endPredicate
public void endPredicate() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a predicate.- Specified by:
endPredicate
in interfaceXPathHandler
- Throws:
SAXPathException
-
startFilterExpr
public void startFilterExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of a filter expression.- Specified by:
startFilterExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endFilterExpr
public void endFilterExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a filter expression.- Specified by:
endFilterExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
startOrExpr
public void startOrExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of an 'or' expression.- Specified by:
startOrExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endOrExpr
public void endOrExpr(boolean create) throws SAXPathException
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
public void startAndExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of an 'and' expression.- Specified by:
startAndExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endAndExpr
public void endAndExpr(boolean create) throws SAXPathException
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
public void startEqualityExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of an equality ('=' or '!=') expression.- Specified by:
startEqualityExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endEqualityExpr
public void endEqualityExpr(int operator) throws SAXPathException
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
public void startRelationalExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.- Specified by:
startRelationalExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endRelationalExpr
public void endRelationalExpr(int operator) throws SAXPathException
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
public void startAdditiveExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of an additive ('+' or '-') expression.- Specified by:
startAdditiveExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endAdditiveExpr
public void endAdditiveExpr(int operator) throws SAXPathException
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
public void startMultiplicativeExpr() throws SAXPathException
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
public void endMultiplicativeExpr(int operator) throws SAXPathException
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
public void startUnaryExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of a unary ('+' or '-') expression.- Specified by:
startUnaryExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endUnaryExpr
public void endUnaryExpr(int operator) throws SAXPathException
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
public void startUnionExpr() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the start of a union ('|') expression.- Specified by:
startUnionExpr
in interfaceXPathHandler
- Throws:
SAXPathException
-
endUnionExpr
public void endUnionExpr(boolean create) throws SAXPathException
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
public void number(int number) throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of a number expression.- Specified by:
number
in interfaceXPathHandler
- Parameters:
number
- the number value- Throws:
SAXPathException
-
number
public void number(double number) throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of a number expression.- Specified by:
number
in interfaceXPathHandler
- Parameters:
number
- the number value- Throws:
SAXPathException
-
literal
public void literal(java.lang.String literal) throws SAXPathException
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
public void variableReference(java.lang.String prefix, java.lang.String variableName) throws SAXPathException
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
public void startFunction(java.lang.String prefix, java.lang.String functionName) throws SAXPathException
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
public void endFunction() throws SAXPathException
Description copied from interface:XPathHandler
Receive notification of the end of a function call- Specified by:
endFunction
in interfaceXPathHandler
- Throws:
SAXPathException
-
-