lux.xpath
Class PathExpression
java.lang.Object
lux.xpath.AbstractExpression
lux.xpath.PathExpression
- All Implemented Interfaces:
- Visitable
public class PathExpression
- extends AbstractExpression
A path expression represents two expressions joined with a "/"
- Author:
- sokolov
PathExpression
public PathExpression(AbstractExpression lhs,
AbstractExpression rhs)
getRHS
public final AbstractExpression getRHS()
getLHS
public final AbstractExpression getLHS()
getPrecedence
public int getPrecedence()
- Specified by:
getPrecedence in class AbstractExpression
- Returns:
- 18
toString
public void toString(StringBuilder buf)
- Description copied from class:
AbstractExpression
- Each subclass must implement the toString(StringBuilder) method by
rendering itself as a syntatically valid XPath/XQuery expression in
the given buffer.
- Specified by:
toString in class AbstractExpression
getRoot
public AbstractExpression getRoot()
- Whenever we see a new absolute context (/, collection(), search()), its dependent
expressions are a possible target for optimization.
- Overrides:
getRoot in class AbstractExpression
- Returns:
- the root of this path, or null if it is not an absolute path.
accept
public AbstractExpression accept(ExpressionVisitor visitor)
getTail
public AbstractExpression getTail()
- Overrides:
getTail in class AbstractExpression
- Returns:
- the expression remaining after removing the left-most sub-expression (the CDR).
getLastContextStep
public AbstractExpression getLastContextStep()
- Description copied from class:
AbstractExpression
- This method is called by the optimizer in order to determine an element or attribute QName (or wildcard) against which
some expression is being compared, in order to generate an appropriate text query.
- Overrides:
getLastContextStep in class AbstractExpression
- Returns:
- the rightmost step of this path expression
getBindingContext
public VariableContext getBindingContext()
- Description copied from class:
AbstractExpression
- If this expression depends "directly" on a variable, return that variable's binding context: a for or let clause,
or a global variable definition. This recurses through variables, so if there are aliases it retrieves the ultimate
context. We need to define directly dependent precisely; what it's used for is to determine with an order by
expression is dependent on a for-variable, and ultimately whether an order by optimization can be applied.
- Overrides:
getBindingContext in class AbstractExpression
- Returns:
- the context in which a variable in the LHS of the path is bound, if any
Copyright © 2013. All Rights Reserved.