Package org.codehaus.groovy.classgen.asm

# Class ClosureWriter

java.lang.Object
org.codehaus.groovy.classgen.asm.ClosureWriter

Direct Known Subclasses:
  `LambdaWriter`, `StaticTypesClosureWriter`

    public class ClosureWriter
    extends java.lang.Object

- ## Nested Class Summary

  Nested Classes
  Modifier and Type | Class | Description
  --- | --- | ---
  `protected static class` | `ClosureWriter.CorrectAccessedVariableVisitor` |
  `protected static interface` | `ClosureWriter.UseExistingReference` |

- ## Field Summary

  Fields
  Modifier and Type | Field | Description
  --- | --- | ---
  `protected WriterController` | `controller` |
  `static java.lang.String` | `OUTER_INSTANCE` |
  `static java.lang.String` | `THIS_OBJECT` |

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `ClosureWriter​(WriterController controller)` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `protected ConstructorNode` | `addConstructor​(ClosureExpression expression, Parameter[] localVariableParams, InnerClassNode answer, BlockStatement block)` |
  `protected void` | `addFieldsAndGettersForLocalVariables​(InnerClassNode answer, Parameter[] localVariableParams)` |
  `boolean` | `addGeneratedClosureConstructorCall​(ConstructorCallExpression call)` |
  `protected BlockStatement` | `createBlockStatementForConstructor​(ClosureExpression expression, ClassNode outerClass, ClassNode thisClassNode)` |
  `protected ClassNode` | `createClosureClass​(ClosureExpression expression, int modifiers)` |
  `protected Parameter[]` | `getClosureSharedVariables​(ClosureExpression ce)` |
  `ClassNode` | `getOrAddClosureClass​(ClosureExpression expression, int modifiers)` |
  `static void` | `loadReference​(java.lang.String name, WriterController controller)` |
  `protected void` | `loadThis()` |
  `protected static void` | `removeInitialValues​(Parameter[] params)` |
  `void` | `writeClosure​(ClosureExpression expression)` |

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

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

- ## Field Details

  - ### OUTER_INSTANCE

    public static final java.lang.String OUTER_INSTANCE
    See Also:
      Constant Field Values

  - ### THIS_OBJECT

    public static final java.lang.String THIS_OBJECT
    See Also:
      Constant Field Values

  - ### controller

    protected final WriterController controller

- ## Constructor Details

  - ### ClosureWriter

    public ClosureWriter​(WriterController controller)

- ## Method Details

  - ### writeClosure

    public void writeClosure​(ClosureExpression expression)

  - ### loadReference

    public static void loadReference​(java.lang.String name, WriterController controller)

  - ### getOrAddClosureClass

    public ClassNode getOrAddClosureClass​(ClosureExpression expression, int modifiers)

  - ### createClosureClass

    protected ClassNode createClosureClass​(ClosureExpression expression, int modifiers)

  - ### addConstructor

    protected ConstructorNode addConstructor​(ClosureExpression expression, Parameter[] localVariableParams, InnerClassNode answer, BlockStatement block)

  - ### addFieldsAndGettersForLocalVariables

    protected void addFieldsAndGettersForLocalVariables​(InnerClassNode answer, Parameter[] localVariableParams)

  - ### createBlockStatementForConstructor

    protected BlockStatement createBlockStatementForConstructor​(ClosureExpression expression, ClassNode outerClass, ClassNode thisClassNode)

  - ### removeInitialValues

    protected static void removeInitialValues​(Parameter[] params)

  - ### addGeneratedClosureConstructorCall

    public boolean addGeneratedClosureConstructorCall​(ConstructorCallExpression call)

  - ### getClosureSharedVariables

    protected Parameter[] getClosureSharedVariables​(ClosureExpression ce)

  - ### loadThis

    protected void loadThis()