| java.lang.Object org.apache.xpath.XPathVisitor
All known Subclasses: org.apache.xalan.templates.AbsPathChecker, org.apache.xalan.extensions.ExpressionVisitor, org.apache.xpath.axes.HasPositionalPredChecker, org.apache.xalan.templates.VarNameCollector, org.apache.xalan.templates.XSLTVisitor,
XPathVisitor | public class XPathVisitor (Code) | | A derivation from this class can be passed to a class that implements
the XPathVisitable interface, to have the appropriate method called
for each component of the XPath. Aside from possible other uses, the
main intention is to provide a reasonable means to perform expression
rewriting.
Each method has the form
boolean visitComponentType(ExpressionOwner owner, ComponentType compType) .
The ExpressionOwner argument is the owner of the component, and can
be used to reset the expression for rewriting. If a method returns
false, the sub hierarchy will not be traversed.
This class is meant to be a base class that will be derived by concrete classes,
and doesn't much except return true for each method.
|
Method Summary | |
public boolean | visitBinaryOperation(ExpressionOwner owner, Operation op) Visit a binary operation.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: op - The operation object. | public boolean | visitFunction(ExpressionOwner owner, Function func) Visit a function.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: func - The function reference object. | public boolean | visitLocationPath(ExpressionOwner owner, LocPathIterator path) Visit a LocationPath.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: path - The LocationPath object. | public boolean | visitMatchPattern(ExpressionOwner owner, StepPattern pattern) Visit a match pattern.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: pattern - The match pattern object. | public boolean | visitNumberLiteral(ExpressionOwner owner, XNumber num) Visit a number literal.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: num - The number literal object. | public boolean | visitPredicate(ExpressionOwner owner, Expression pred) Visit a predicate within a location path. | public boolean | visitStep(ExpressionOwner owner, NodeTest step) Visit a step within a location path.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: step - The Step object. | public boolean | visitStringLiteral(ExpressionOwner owner, XString str) Visit a string literal.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: str - The string literal object. | public boolean | visitUnaryOperation(ExpressionOwner owner, UnaryOperation op) Visit a unary operation.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: op - The operation object. | public boolean | visitUnionPath(ExpressionOwner owner, UnionPathIterator path) Visit a UnionPath.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: path - The UnionPath object. | public boolean | visitUnionPattern(ExpressionOwner owner, UnionPattern pattern) Visit a union pattern.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: pattern - The union pattern object. | public boolean | visitVariableRef(ExpressionOwner owner, Variable var) Visit a variable reference.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: var - The variable reference object. |
visitBinaryOperation | public boolean visitBinaryOperation(ExpressionOwner owner, Operation op)(Code) | | Visit a binary operation.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: op - The operation object. true if the sub expressions should be traversed. |
visitFunction | public boolean visitFunction(ExpressionOwner owner, Function func)(Code) | | Visit a function.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: func - The function reference object. true if the sub expressions should be traversed. |
visitLocationPath | public boolean visitLocationPath(ExpressionOwner owner, LocPathIterator path)(Code) | | Visit a LocationPath.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: path - The LocationPath object. true if the sub expressions should be traversed. |
visitMatchPattern | public boolean visitMatchPattern(ExpressionOwner owner, StepPattern pattern)(Code) | | Visit a match pattern.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: pattern - The match pattern object. true if the sub expressions should be traversed. |
visitNumberLiteral | public boolean visitNumberLiteral(ExpressionOwner owner, XNumber num)(Code) | | Visit a number literal.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: num - The number literal object. true if the sub expressions should be traversed. |
visitPredicate | public boolean visitPredicate(ExpressionOwner owner, Expression pred)(Code) | | Visit a predicate within a location path. Note that there isn't a
proper unique component for predicates, and that the expression will
be called also for whatever type Expression is.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: pred - The predicate object. true if the sub expressions should be traversed. |
visitStep | public boolean visitStep(ExpressionOwner owner, NodeTest step)(Code) | | Visit a step within a location path.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: step - The Step object. true if the sub expressions should be traversed. |
visitStringLiteral | public boolean visitStringLiteral(ExpressionOwner owner, XString str)(Code) | | Visit a string literal.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: str - The string literal object. true if the sub expressions should be traversed. |
visitUnaryOperation | public boolean visitUnaryOperation(ExpressionOwner owner, UnaryOperation op)(Code) | | Visit a unary operation.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: op - The operation object. true if the sub expressions should be traversed. |
visitUnionPath | public boolean visitUnionPath(ExpressionOwner owner, UnionPathIterator path)(Code) | | Visit a UnionPath.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: path - The UnionPath object. true if the sub expressions should be traversed. |
visitUnionPattern | public boolean visitUnionPattern(ExpressionOwner owner, UnionPattern pattern)(Code) | | Visit a union pattern.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: pattern - The union pattern object. true if the sub expressions should be traversed. |
visitVariableRef | public boolean visitVariableRef(ExpressionOwner owner, Variable var)(Code) | | Visit a variable reference.
Parameters: owner - The owner of the expression, to which the expression can be reset if rewriting takes place. Parameters: var - The variable reference object. true if the sub expressions should be traversed. |
|
|