public class ExpressionAsVariableSlot
extends BytecodeExpression
Helper class that takes an Expression and if visited will load it normally, storing the result in a helper variable, which then can be requested after the visit is completed. A copy of the variable will stay on the stack. Subsequent visits will load the stored value instead of visiting the expression again
| Fields inherited from class | Fields |
|---|---|
class BytecodeExpression |
NOP |
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
ExpressionAsVariableSlot(WriterController controller, Expression expression, String name)Creates an expression that stores an expression result in a temporary variable. |
ExpressionAsVariableSlot(WriterController controller, Expression expression)Creates an expression that stores an expression result in a temporary variable. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public int |
getIndex()returns the index of the bytecode variable |
|
public String |
getText()* * Returns a human-readable text representation of this AST node. * Used for debugging and error messages. Default implementation returns a message * indicating the representation is not yet implemented for this node type. * *
|
|
public void |
visit(org.objectweb.asm.MethodVisitor mv)* Emits bytecode instructions using the provided method visitor. * *
|
| Methods inherited from class | Name |
|---|---|
class BytecodeExpression |
getText, transformExpression, visit, visit |
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 |
Creates an expression that stores an expression result in a temporary variable.
controller - the writer controllerexpression - the expression to evaluate and storename - the name for the temporary variableCreates an expression that stores an expression result in a temporary variable.
controller - the writer controllerexpression - the expression to evaluate and storereturns the index of the bytecode variable
* * Returns a human-readable text representation of this AST node. * Used for debugging and error messages. Default implementation returns a message * indicating the representation is not yet implemented for this node type. * *
* Emits bytecode instructions using the provided method visitor. * *
visitor - the ASM method visitor to generate bytecodeCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.