public class TemporaryVariableExpression
extends Expression
A front-end class for ExpressionAsVariableSlot which allows defining temporary variables loaded from variable slots directly at the AST level, without any knowledge of AsmClassGenerator.
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
TemporaryVariableExpression(Expression expression)Wraps an expression so it can be cached in a temporary variable slot during bytecode generation. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public ClassNode |
getType()Returns the wrapped expression type. |
|
public void |
remove(WriterController controller)Releases the temporary variable slot associated with this expression. |
|
public Expression |
transformExpression(ExpressionTransformer transformer)Transforms the wrapped expression while preserving the shared variable slot. |
|
public void |
visit(GroovyCodeVisitor visitor)Emits the cached variable-slot access when visiting bytecode, or delegates to the wrapped expression otherwise. |
| Methods inherited from class | Name |
|---|---|
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Wraps an expression so it can be cached in a temporary variable slot during bytecode generation.
expression - the expression to cacheReturns the wrapped expression type.
Releases the temporary variable slot associated with this expression.
controller - the active writer controllerTransforms the wrapped expression while preserving the shared variable slot.
transformer - the expression transformer to applyEmits the cached variable-slot access when visiting bytecode, or delegates to the wrapped expression otherwise.
visitor - the visitor to acceptCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.