org.jaxen.saxpath

Interface XPathHandler

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 (e.g. Expr/startExpr()/endExpr()) are not included in this API.

Author: bob mcwhirter (bob@werken.com)

Method Summary
voidendAbsoluteLocationPath()
Receive notification of the end of an absolute location path expression.
voidendAdditiveExpr(int additiveOperator)
Receive notification of the end of an additive ('+' or '-') expression.
voidendAllNodeStep()
Receive notification of the end of a node() step.
voidendAndExpr(boolean create)
Receive notification of the end of an 'and' expression.
voidendCommentNodeStep()
Receive notification of the end of a comment() step.
voidendEqualityExpr(int equalityOperator)
Receive notification of the end of an equality ('=' or '!
voidendFilterExpr()
Receive notification of the end of a filter expression.
voidendFunction()
Receive notification of the end of a function call
voidendMultiplicativeExpr(int multiplicativeOperator)
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.
voidendNameStep()
Receive notification of the end of a NameStep
voidendOrExpr(boolean create)
Receive notification of the end of an 'or' expression.
voidendPathExpr()
Receive notification of the end of a path expression.
voidendPredicate()
Receive notification of the end of a predicate.
voidendProcessingInstructionNodeStep()
Receive notification of the end of a processing-instruction(...) step.
voidendRelationalExpr(int relationalOperator)
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.
voidendRelativeLocationPath()
Receive notification of the end of a relative location path expression.
voidendTextNodeStep()
Receive notification of the end of a text() step.
voidendUnaryExpr(int unaryOperator)
Receive notification of the end of a unary ('+' or '-') expression.
voidendUnionExpr(boolean create)
Receive notification of the end of a union ('|') expression.
voidendXPath()
Receive notification of the end of an XPath expression parse.
voidliteral(String literal)
Receive notification of a literal expression.
voidnumber(int number)
Receive notification of a number expression.
voidnumber(double number)
Receive notification of a number expression.
voidstartAbsoluteLocationPath()
Receive notification of the start of an absolute location path expression.
voidstartAdditiveExpr()
Receive notification of the start of an additive ('+' or '-') expression.
voidstartAllNodeStep(int axis)
Receive notification of the start of a node() step.
voidstartAndExpr()
Receive notification of the start of an 'and' expression.
voidstartCommentNodeStep(int axis)
Receive notification of the start of a comment() step.
voidstartEqualityExpr()
Receive notification of the start of an equality ('=' or '!
voidstartFilterExpr()
Receive notification of the start of a filter expression.
voidstartFunction(String prefix, String functionName)
Receive notification of a function call.
voidstartMultiplicativeExpr()
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.
voidstartNameStep(int axis, String prefix, String localName)
Receive notification of the start of a name step.
voidstartOrExpr()
Receive notification of the start of an 'or' expression.
voidstartPathExpr()
Receive notification of the start of a path expression.
voidstartPredicate()
Receive notification of the start of a predicate.
voidstartProcessingInstructionNodeStep(int axis, String name)
Receive notification of the start of a processing-instruction(...) step.
voidstartRelationalExpr()
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.
voidstartRelativeLocationPath()
Receive notification of the start of a relative location path expression.
voidstartTextNodeStep(int axis)
Receive notification of the start of a text() step.
voidstartUnaryExpr()
Receive notification of the start of a unary ('+' or '-') expression.
voidstartUnionExpr()
Receive notification of the start of a union ('|') expression.
voidstartXPath()
Receive notification of the start of an XPath expression parse.
voidvariableReference(String prefix, String variableName)
Receive notification of a variable-reference expression.

Method Detail

endAbsoluteLocationPath

public void endAbsoluteLocationPath()
Receive notification of the end of an absolute location path expression.

endAdditiveExpr

public void endAdditiveExpr(int additiveOperator)
Receive notification of the end of an additive ('+' or '-') expression.

Parameters: additiveOperator the operator specific to this particular additive expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated.

endAllNodeStep

public void endAllNodeStep()
Receive notification of the end of a node() step.

endAndExpr

public void endAndExpr(boolean create)
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

endCommentNodeStep

public void endCommentNodeStep()
Receive notification of the end of a comment() step.

endEqualityExpr

public void endEqualityExpr(int equalityOperator)
Receive notification of the end of an equality ('=' or '!=') expression.

Parameters: equalityOperator the operator specific to this particular equality expression. If null, this expression is only a pass-through, and should not actually be instantiated.

endFilterExpr

public void endFilterExpr()
Receive notification of the end of a filter expression.

endFunction

public void endFunction()
Receive notification of the end of a function call

endMultiplicativeExpr

public void endMultiplicativeExpr(int multiplicativeOperator)
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.

Parameters: multiplicativeOperator the operator specific to this particular multiplicative expression. If null, this expression is only a pass-through, and should not actually be instantiated.

endNameStep

public void endNameStep()
Receive notification of the end of a NameStep

endOrExpr

public void endOrExpr(boolean create)
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

endPathExpr

public void endPathExpr()
Receive notification of the end of a path expression.

endPredicate

public void endPredicate()
Receive notification of the end of a predicate.

endProcessingInstructionNodeStep

public void endProcessingInstructionNodeStep()
Receive notification of the end of a processing-instruction(...) step.

endRelationalExpr

public void endRelationalExpr(int relationalOperator)
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.

Parameters: relationalOperator the operator specific to this particular relational expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated.

endRelativeLocationPath

public void endRelativeLocationPath()
Receive notification of the end of a relative location path expression.

endTextNodeStep

public void endTextNodeStep()
Receive notification of the end of a text() step.

endUnaryExpr

public void endUnaryExpr(int unaryOperator)
Receive notification of the end of a unary ('+' or '-') expression.

Parameters: unaryOperator 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 not NO_OP, it will always be NEGATIVE.

endUnionExpr

public void endUnionExpr(boolean create)
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

endXPath

public void endXPath()
Receive notification of the end of an XPath expression parse.

literal

public void literal(String literal)
Receive notification of a literal expression.

Parameters: literal the string literal value

number

public void number(int number)
Receive notification of a number expression.

Parameters: number the number value

number

public void number(double number)
Receive notification of a number expression.

Parameters: number the number value

startAbsoluteLocationPath

public void startAbsoluteLocationPath()
Receive notification of the start of an absolute location path expression.

startAdditiveExpr

public void startAdditiveExpr()
Receive notification of the start of an additive ('+' or '-') expression.

startAllNodeStep

public void startAllNodeStep(int axis)
Receive notification of the start of a node() step.

Parameters: axis the axis of this step

startAndExpr

public void startAndExpr()
Receive notification of the start of an 'and' expression.

startCommentNodeStep

public void startCommentNodeStep(int axis)
Receive notification of the start of a comment() step.

Parameters: axis the axis of this step

startEqualityExpr

public void startEqualityExpr()
Receive notification of the start of an equality ('=' or '!=') expression.

startFilterExpr

public void startFilterExpr()
Receive notification of the start of a filter expression.

startFunction

public void startFunction(String prefix, String functionName)
Receive notification of a function call.

Parameters: prefix the namespace prefix of the function functionName the local name of the function

startMultiplicativeExpr

public void startMultiplicativeExpr()
Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.

startNameStep

public void startNameStep(int axis, String prefix, String localName)
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

startOrExpr

public void startOrExpr()
Receive notification of the start of an 'or' expression.

startPathExpr

public void startPathExpr()
Receive notification of the start of a path expression.

startPredicate

public void startPredicate()
Receive notification of the start of a predicate.

startProcessingInstructionNodeStep

public void startProcessingInstructionNodeStep(int axis, String name)
Receive notification of the start of a processing-instruction(...) step.

Parameters: axis the axis of this step name the name of the processing-instruction, or the empty string if none is specified

startRelationalExpr

public void startRelationalExpr()
Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.

startRelativeLocationPath

public void startRelativeLocationPath()
Receive notification of the start of a relative location path expression.

startTextNodeStep

public void startTextNodeStep(int axis)
Receive notification of the start of a text() step.

Parameters: axis the axis of this step

startUnaryExpr

public void startUnaryExpr()
Receive notification of the start of a unary ('+' or '-') expression.

startUnionExpr

public void startUnionExpr()
Receive notification of the start of a union ('|') expression.

startXPath

public void startXPath()
Receive notification of the start of an XPath expression parse.

variableReference

public void variableReference(String prefix, String variableName)
Receive notification of a variable-reference expression.

Parameters: prefix the namespace prefix of the variable variableName the local name of the variable