public class VariableExpressionTransformer
extends Object
implements ExpressionTransformer
An expression transformer used in the process of replacing the access to variables
| Constructor and description |
|---|
VariableExpressionTransformer(Closure<Boolean> when, Closure<VariableExpression> replaceWith)Creates a transformer with the supplied predicate and replacement strategy. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Closure<VariableExpression> |
getReplaceWith()Returns the closure that creates replacement variable expressions. |
|
public Closure<Boolean> |
getWhen()Returns the predicate that decides whether a variable expression should be replaced. |
|
public void |
setReplaceWith(Closure<VariableExpression> replaceWith)Sets the closure that creates replacement variable expressions. |
|
public void |
setWhen(Closure<Boolean> when)Sets the predicate that decides whether a variable expression should be replaced. |
|
public Expression |
transform(Expression expr)* Transforms the given expression. * *
|
Creates a transformer with the supplied predicate and replacement strategy.
when - decides whether a variable expression should be replacedreplaceWith - creates the replacement variable expressionReturns the closure that creates replacement variable expressions.
Returns the predicate that decides whether a variable expression should be replaced.
Sets the closure that creates replacement variable expressions.
replaceWith - the replacement closureSets the predicate that decides whether a variable expression should be replaced.
when - the replacement predicate* Transforms the given expression. * *
expression - the expression to transform, may be null
*Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.