Package org.codehaus.groovy.classgen.asm

# Class ExpressionAsVariableSlot

java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotatedNode
org.codehaus.groovy.ast.expr.Expression
org.codehaus.groovy.classgen.BytecodeExpression
org.codehaus.groovy.classgen.asm.ExpressionAsVariableSlot

All Implemented Interfaces:
  `GroovydocHolder<AnnotatedNode>`, `NodeMetaDataHandler`

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

- ## Field Summary

  ### Fields inherited from class org.codehaus.groovy.classgen.BytecodeExpression

  `NOP`

  ### Fields inherited from class org.codehaus.groovy.ast.expr.Expression

  `EMPTY_ARRAY`

  ### Fields inherited from interface groovy.lang.groovydoc.GroovydocHolder

  `DOC_COMMENT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ExpressionAsVariableSlot(WriterController controller, Expression expression)`
  `ExpressionAsVariableSlot(WriterController controller, Expression expression, String name)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getIndex()`
  returns the index of the bytecode variable
  `String`
  `getText()`
  `void`
  `visit(org.objectweb.asm.MethodVisitor mv)`

  ### Methods inherited from class org.codehaus.groovy.classgen.BytecodeExpression

  `transformExpression, visit`

  ### Methods inherited from class org.codehaus.groovy.ast.expr.Expression

  `getType, setType, transformExpressions, transformExpressions`

  ### Methods inherited from class org.codehaus.groovy.ast.AnnotatedNode

  `addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic`

  ### Methods inherited from class org.codehaus.groovy.ast.ASTNode

  `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.codehaus.groovy.ast.NodeMetaDataHandler

  `copyNodeMetaData, getNodeMetaData, getNodeMetaData, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setNodeMetaData`

- ## Constructor Details

  - ### ExpressionAsVariableSlot

    public ExpressionAsVariableSlot(WriterController controller, Expression expression, String name)

  - ### ExpressionAsVariableSlot

    public ExpressionAsVariableSlot(WriterController controller, Expression expression)

- ## Method Details

  - ### visit

    public void visit(org.objectweb.asm.MethodVisitor mv)
    Specified by:
      `visit` in class `BytecodeExpression`

  - ### getIndex

    public int getIndex()
    returns the index of the bytecode variable

  - ### getText

    public String getText()
    Overrides:
      `getText` in class `ASTNode`