net.sf.saxon.expr
public class ExpressionVisitor extends Object
Constructor Summary | |
---|---|
ExpressionVisitor()
Create an ExpressionVisitor |
Method Summary | |
---|---|
Configuration | getConfiguration()
Get the Saxon configuration |
Expression | getCurrentExpression()
Get the current expression, the one being visited |
Executable | getExecutable()
Get the Executable containing the expressions being visited |
Expression | getParentExpression()
Get the parent expression of the current expression in the expression tree |
Stack<Expression> | getStack()
Get the stack containing all the expressions currently being visited |
StaticContext | getStaticContext()
Get the static context for the expressions being visited. |
boolean | isLoopingSubexpression(Expression ancestor)
Return true if the current expression at the top of the visitor's stack is evaluated repeatedly
when a given ancestor expression is evaluated once |
static ExpressionVisitor | make(StaticContext env)
Factory method: make an expression visitor |
Expression | optimize(Expression exp, ItemType contextItemType)
Optimize an expression, via the ExpressionVisitor |
void | resetStaticProperties()
Reset the static properties for the current expression and for all its containing expressions.
|
void | setConfiguration(Configuration configuration)
Set the Saxon configuration |
void | setExecutable(Executable executable)
Set the Executable containing the expressions being visited |
void | setStack(Stack<Expression> stack)
Set the stack used to hold the expressions being visited |
void | setStaticContext(StaticContext staticContext)
Set the static context for the expressions being visited. |
Expression | simplify(Expression exp)
Simplify an expression, via the ExpressionVisitor |
Expression | typeCheck(Expression exp, ItemType contextItemType)
Type check an expression, via the ExpressionVisitor |
Returns: the Saxon configuration
Returns: the current expression
Returns: the Executable
Returns: the parent of the current expression (or null if this is the root)
Returns: the expression stack holding all the containing expressions of the current expression; the objects on this Stack are instances of Expression
Returns: the static context
Parameters: ancestor the ancestor expression. May be null, in which case the search goes all the way to the base of the stack.
Returns: true if the current expression is evaluated repeatedly
Parameters: env the static context
Returns: the new expression visitor
Parameters: exp the expression to be typechecked contextItemType the static type of the context item for this expression
Returns: the rewritten expression
Throws: XPathException
Parameters: configuration the Saxon configuration
Parameters: executable the Executable
Parameters: stack the expression stack
Parameters: staticContext the static context
Parameters: exp the expression to be simplified
Returns: the simplified expression
Throws: XPathException
Parameters: exp the expression to be typechecked contextItemType the static type of the context item for this expression
Returns: the expression that results from type checking (this may be wrapped in expressions that perform dynamic checking of the item type or cardinality, or that perform atomization or numeric promotion)
Throws: XPathException if static type checking fails, that is, if the expression cannot possibly deliver a value of the required type