public class ExpressionVisitor
extends java.lang.Object
Constructor and Description |
---|
ExpressionVisitor()
Create an ExpressionVisitor
|
Modifier and Type | Method and Description |
---|---|
Configuration |
getConfiguration()
Get the Saxon configuration
|
Container |
getContainer()
Get the container of the expressions being visited
|
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
|
java.util.Stack |
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 |
setContainer(Container container)
Set the container of the expressions being visited
|
void |
setExecutable(Executable executable)
Set the Executable containing the expressions being visited
|
void |
setStack(java.util.Stack 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
|
public Configuration getConfiguration()
public void setConfiguration(Configuration configuration)
configuration
- the Saxon configurationpublic Container getContainer()
public void setContainer(Container container)
container
- the containerpublic Executable getExecutable()
public void setExecutable(Executable executable)
executable
- the Executablepublic java.util.Stack getStack()
Expression
public void setStack(java.util.Stack stack)
stack
- the expression stackpublic StaticContext getStaticContext()
public void setStaticContext(StaticContext staticContext)
staticContext
- the static contextpublic Expression getCurrentExpression()
public static ExpressionVisitor make(StaticContext env)
env
- the static contextpublic Expression simplify(Expression exp) throws XPathException
exp
- the expression to be simplifiedXPathException
public Expression typeCheck(Expression exp, ItemType contextItemType) throws XPathException
exp
- the expression to be typecheckedcontextItemType
- the static type of the context item for this expressionXPathException
- if static type checking fails, that is, if the expression cannot possibly
deliver a value of the required typepublic Expression optimize(Expression exp, ItemType contextItemType) throws XPathException
exp
- the expression to be typecheckedcontextItemType
- the static type of the context item for this expressionXPathException
public Expression getParentExpression()
public boolean isLoopingSubexpression(Expression ancestor)
ancestor
- the ancestor expression. May be null, in which case the search goes all the way
to the base of the stack.public final void resetStaticProperties()