FileDocCategorySizeDatePackage
XPathVisitor.javaAPI DocJava SE 5 API6784Fri Aug 26 14:56:06 BST 2005com.sun.org.apache.xpath.internal

XPathVisitor

public class XPathVisitor extends Object
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.

Fields Summary
Constructors Summary
Methods Summary
public booleanvisitBinaryOperation(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.operations.Operation op)
Visit a binary operation.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
op The operation object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitFunction(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.functions.Function func)
Visit a function.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
func The function reference object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitLocationPath(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.axes.LocPathIterator path)
Visit a LocationPath.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
path The LocationPath object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitMatchPattern(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.patterns.StepPattern pattern)
Visit a match pattern.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
pattern The match pattern object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitNumberLiteral(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.objects.XNumber num)
Visit a number literal.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
num The number literal object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitPredicate(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.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.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
pred The predicate object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitStep(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.patterns.NodeTest step)
Visit a step within a location path.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
step The Step object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitStringLiteral(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.objects.XString str)
Visit a string literal.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
str The string literal object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitUnaryOperation(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.operations.UnaryOperation op)
Visit a unary operation.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
op The operation object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitUnionPath(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.axes.UnionPathIterator path)
Visit a UnionPath.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
path The UnionPath object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitUnionPattern(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.patterns.UnionPattern pattern)
Visit a union pattern.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
pattern The union pattern object.
return
true if the sub expressions should be traversed.

		return true;
	
public booleanvisitVariableRef(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.operations.Variable var)
Visit a variable reference.

param
owner The owner of the expression, to which the expression can be reset if rewriting takes place.
param
var The variable reference object.
return
true if the sub expressions should be traversed.

		return true;