org.apache.xpath.axes
Class HasPositionalPredChecker

java.lang.Object
  extended by org.apache.xpath.XPathVisitor
      extended by org.apache.xpath.axes.HasPositionalPredChecker

public class HasPositionalPredChecker
extends XPathVisitor


Field Summary
private  boolean m_hasPositionalPred
           
private  int m_predDepth
           
 
Constructor Summary
HasPositionalPredChecker()
           
 
Method Summary
static boolean check(LocPathIterator path)
          Process the LocPathIterator to see if it contains variables or functions that may make it context dependent.
 boolean visitFunction(ExpressionOwner owner, Function func)
          Visit a function.
 boolean visitPredicate(ExpressionOwner owner, Expression pred)
          Visit a predicate within a location path.
 
Methods inherited from class org.apache.xpath.XPathVisitor
visitBinaryOperation, visitLocationPath, visitMatchPattern, visitNumberLiteral, visitStep, visitStringLiteral, visitUnaryOperation, visitUnionPath, visitUnionPattern, visitVariableRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_hasPositionalPred

private boolean m_hasPositionalPred

m_predDepth

private int m_predDepth
Constructor Detail

HasPositionalPredChecker

public HasPositionalPredChecker()
Method Detail

check

public static boolean check(LocPathIterator path)
Process the LocPathIterator to see if it contains variables or functions that may make it context dependent.

Parameters:
path - LocPathIterator that is assumed to be absolute, but needs checking.
Returns:
true if the path is confirmed to be absolute, false if it may contain context dependencies.

visitFunction

public boolean visitFunction(ExpressionOwner owner,
                             Function func)
Visit a function.

Overrides:
visitFunction in class XPathVisitor
Parameters:
owner - The owner of the expression, to which the expression can be reset if rewriting takes place.
func - The function reference object.
Returns:
true if the sub expressions should be traversed.

visitPredicate

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.

Overrides:
visitPredicate in class XPathVisitor
Parameters:
owner - The owner of the expression, to which the expression can be reset if rewriting takes place.
pred - The predicate object.
Returns:
true if the sub expressions should be traversed.