Package org.saxpath
Interface XPathHandler
- All Known Implementing Classes:
ConformanceXPathHandler
public interface XPathHandler
Interface for event-based XPath parsing.
A XPathReader
generates callbacks into
an XPathHandler
to allow for custom
handling of the parse.
The callbacks very closely match the productions listed in the W3C XPath specification. Gratuitous productions (ie, Expr/startExpr()/endExpr())are not included in this API.
- Author:
- bob mcwhirter (bob@werken.com)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Receive notification of the end of an absolute location path expression.void
endAdditiveExpr
(int additiveOperator) 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 equalityOperator) 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 call.void
endMultiplicativeExpr
(int multiplicativeOperator) 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 relationalOperator) Receive notification of the start of a relational ('invalid input: '<'', '>', 'invalid input: '<'=', 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 unaryOperator) 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 ('invalid input: '<'', '>', 'invalid input: '<'=', 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.
-
Method Details
-
startXPath
Receive notification of the start of an XPath expression parse.- Throws:
SAXPathException
-
endXPath
Receive notification of the end of an XPath expression parse.- Throws:
SAXPathException
-
startPathExpr
Receive notification of the start of a path expression.- Throws:
SAXPathException
-
endPathExpr
Receive notification of the end of a path expression.- Throws:
SAXPathException
-
startAbsoluteLocationPath
Receive notification of the start of an absolute location path expression.- Throws:
SAXPathException
-
endAbsoluteLocationPath
Receive notification of the end of an absolute location path expression.- Throws:
SAXPathException
-
startRelativeLocationPath
Receive notification of the start of a relative location path expression.- Throws:
SAXPathException
-
endRelativeLocationPath
Receive notification of the end of a relative location path expression.- Throws:
SAXPathException
-
startNameStep
Receive notification of the start of a name step.- 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.- Throws:
SAXPathException
-
endNameStep
Receive notification of the end of a NameStep- Throws:
SAXPathException
-
startTextNodeStep
Receive notification of the start of a text() step.- Parameters:
axis
- The axis of this step.- Throws:
SAXPathException
-
endTextNodeStep
Receive notification of the end of a text() step.- Throws:
SAXPathException
-
startCommentNodeStep
Receive notification of the start of a comment() step.- Parameters:
axis
- The axis of this step.- Throws:
SAXPathException
-
endCommentNodeStep
Receive notification of the end of a comment() step.- Throws:
SAXPathException
-
startAllNodeStep
Receive notification of the start of a node() step.- Parameters:
axis
- The axis of this step.- Throws:
SAXPathException
-
endAllNodeStep
Receive notification of the end of a node() step.- Throws:
SAXPathException
-
startProcessingInstructionNodeStep
Receive notification of the start of a processing-instruction(...) step.- Parameters:
axis
- The axis of this step.name
- The name of the processing-instruction, of the empty-string if none is specified.- Throws:
SAXPathException
-
endProcessingInstructionNodeStep
Receive notification of the end of a processing-instruction(...) step.- Throws:
SAXPathException
-
startPredicate
Receive notification of the start of a predicate.- Throws:
SAXPathException
-
endPredicate
Receive notification of the end of a predicate.- Throws:
SAXPathException
-
startFilterExpr
Receive notification of the start of a filter expression.- Throws:
SAXPathException
-
endFilterExpr
Receive notification of the end of a filter expression.- Throws:
SAXPathException
-
startOrExpr
Receive notification of the start of an 'or' expression.- Throws:
SAXPathException
-
endOrExpr
Receive notification of the end of an 'or' expression.- 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
Receive notification of the start of an 'and' expression.- Throws:
SAXPathException
-
endAndExpr
Receive notification of the end of an 'and' expression.- 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
Receive notification of the start of an equality ('=' or '!=') expression.- Throws:
SAXPathException
-
endEqualityExpr
Receive notification of the end of an equality ('=' or '!=') expression.- 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
Receive notification of the start of a relational ('invalid input: '<'', '>', 'invalid input: '<'=', or '>=') expression.- Throws:
SAXPathException
-
endRelationalExpr
Receive notification of the start of a relational ('invalid input: '<'', '>', 'invalid input: '<'=', or '>=') expression.- Parameters:
operator
- The operator specific to this particular relational expression. If null, this expression is only a pass-through, and should not actually be instantiated.- Throws:
SAXPathException
-
startAdditiveExpr
Receive notification of the start of an additive ('+' or '-') expression.- Throws:
SAXPathException
-
endAdditiveExpr
Receive notification of the end of an additive ('+' or '-') expression.- Parameters:
operator
- The operator specific to this particular additive expression. If null, this expression is only a pass-through, and should not actually be instantiated.- Throws:
SAXPathException
-
startMultiplicativeExpr
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.- Throws:
SAXPathException
-
endMultiplicativeExpr
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.- 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
Receive notification of the start of a unary ('+' or '-') expression.- Throws:
SAXPathException
-
endUnaryExpr
Receive notification of the end of a unary ('+' or '-') expression.- Parameters:
operator
- The operator specific to this particular unary expression. If null, this expression is only a pass-through, and should not actually be instantiated. If notOperator.NO_OP
, it'll always beOperator.NEGATIVE
.- Throws:
SAXPathException
-
startUnionExpr
Receive notification of the start of a union ('|') expression.- Throws:
SAXPathException
-
endUnionExpr
Receive notification of the end of a union ('|') expression.- 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
Receive notification of a number expression.- Parameters:
number
- The number value.- Throws:
SAXPathException
-
number
Receive notification of a number expression.- Parameters:
number
- The number value.- Throws:
SAXPathException
-
literal
Receive notification of a literal expression.- Parameters:
literal
- The string literal value.- Throws:
SAXPathException
-
variableReference
Receive notification of a variable-reference expression.- Parameters:
prefix
- The ns-uri prefix of the variable.variableName
- The name of the variable.- Throws:
SAXPathException
-
startFunction
Receive notification of a function call.- Parameters:
prefix
- The ns-uri prefix of the function.functionName
- The name of the function.- Throws:
SAXPathException
-
endFunction
Receive notification of the end of a function call.- Throws:
SAXPathException
-