APIdia Launch Partner
Top Description Constructors Methods
com.sun.org.apache.xpath.internal

public Class XPathVisitor

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xpath.internal.axes.HasPositionalPredChecker
Imports
com.sun.org.apache.xpath.internal.axes.LocPathIterator, .UnionPathIterator, com.sun.org.apache.xpath.internal.functions.Function, com.sun.org.apache.xpath.internal.objects.XNumber, .XString, com.sun.org.apache.xpath.internal.operations.Operation, .UnaryOperation, .Variable, com.sun.org.apache.xpath.internal.patterns.NodeTest, .StepPattern, .UnionPattern

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.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the sub expressions should be traversed.
visitBinaryOperation
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
Operation
The operation object.
op
)

Visit a binary operation.

public boolean

Returns:

true if the sub expressions should be traversed.
visitFunction
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
Function
The function reference object.
func
)

Visit a function.

public boolean

Returns:

true if the sub expressions should be traversed.
visitLocationPath
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
LocPathIterator
The LocationPath object.
path
)

Visit a LocationPath.

public boolean

Returns:

true if the sub expressions should be traversed.
visitMatchPattern
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
StepPattern
The match pattern object.
pattern
)

Visit a match pattern.

public boolean

Returns:

true if the sub expressions should be traversed.
visitNumberLiteral
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
XNumber
The number literal object.
num
)

Visit a number literal.

public boolean

Returns:

true if the sub expressions should be traversed.
visitPredicate
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
Expression
The predicate object.
pred
)

Visit a predicate within a location path.

public boolean

Returns:

true if the sub expressions should be traversed.
visitStep
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
NodeTest
The Step object.
step
)

Visit a step within a location path.

public boolean

Returns:

true if the sub expressions should be traversed.
visitStringLiteral
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
XString
The string literal object.
str
)

Visit a string literal.

public boolean

Returns:

true if the sub expressions should be traversed.
visitUnaryOperation
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
UnaryOperation
The operation object.
op
)

Visit a unary operation.

public boolean

Returns:

true if the sub expressions should be traversed.
visitUnionPath
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
UnionPathIterator
The UnionPath object.
path
)

Visit a UnionPath.

public boolean

Returns:

true if the sub expressions should be traversed.
visitUnionPattern
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
UnionPattern
The union pattern object.
pattern
)

Visit a union pattern.

public boolean

Returns:

true if the sub expressions should be traversed.
visitVariableRef
(ExpressionOwner
The owner of the expression, to which the expression can be reset if rewriting takes place.
owner
,
Variable
The variable reference object.
var
)

Visit a variable reference.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

XPathVisitorback to summary
public XPathVisitor()

Method Detail

visitBinaryOperationback to summary
public boolean visitBinaryOperation(ExpressionOwner owner, Operation op)

Visit a binary operation.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

op:Operation

The operation object.

Returns:boolean

true if the sub expressions should be traversed.

visitFunctionback to summary
public boolean visitFunction(ExpressionOwner owner, Function func)

Visit a function.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

func:Function

The function reference object.

Returns:boolean

true if the sub expressions should be traversed.

visitLocationPathback to summary
public boolean visitLocationPath(ExpressionOwner owner, LocPathIterator path)

Visit a LocationPath.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

path:LocPathIterator

The LocationPath object.

Returns:boolean

true if the sub expressions should be traversed.

visitMatchPatternback to summary
public boolean visitMatchPattern(ExpressionOwner owner, StepPattern pattern)

Visit a match pattern.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

pattern:StepPattern

The match pattern object.

Returns:boolean

true if the sub expressions should be traversed.

visitNumberLiteralback to summary
public boolean visitNumberLiteral(ExpressionOwner owner, XNumber num)

Visit a number literal.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

num:XNumber

The number literal object.

Returns:boolean

true if the sub expressions should be traversed.

visitPredicateback to summary
public boolean visitPredicate(ExpressionOwner owner, Expression pred)

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:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

pred:Expression

The predicate object.

Returns:boolean

true if the sub expressions should be traversed.

visitStepback to summary
public boolean visitStep(ExpressionOwner owner, NodeTest step)

Visit a step within a location path.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

step:NodeTest

The Step object.

Returns:boolean

true if the sub expressions should be traversed.

visitStringLiteralback to summary
public boolean visitStringLiteral(ExpressionOwner owner, XString str)

Visit a string literal.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

str:XString

The string literal object.

Returns:boolean

true if the sub expressions should be traversed.

visitUnaryOperationback to summary
public boolean visitUnaryOperation(ExpressionOwner owner, UnaryOperation op)

Visit a unary operation.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

op:UnaryOperation

The operation object.

Returns:boolean

true if the sub expressions should be traversed.

visitUnionPathback to summary
public boolean visitUnionPath(ExpressionOwner owner, UnionPathIterator path)

Visit a UnionPath.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

path:UnionPathIterator

The UnionPath object.

Returns:boolean

true if the sub expressions should be traversed.

visitUnionPatternback to summary
public boolean visitUnionPattern(ExpressionOwner owner, UnionPattern pattern)

Visit a union pattern.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

pattern:UnionPattern

The union pattern object.

Returns:boolean

true if the sub expressions should be traversed.

visitVariableRefback to summary
public boolean visitVariableRef(ExpressionOwner owner, Variable var)

Visit a variable reference.

Parameters
owner:ExpressionOwner

The owner of the expression, to which the expression can be reset if rewriting takes place.

var:Variable

The variable reference object.

Returns:boolean

true if the sub expressions should be traversed.