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 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 final WriterController`
  `controller`
  `static final String`
  `OUTER_INSTANCE`
  `static final 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`
  `addFieldsForLocalVariables(InnerClassNode closureClass, Parameter[] localVariableParams)`
  `boolean`
  `addGeneratedClosureConstructorCall(ConstructorCallExpression call)`
  `protected void`
  `addSerialVersionUIDField(ClassNode classNode)`
  `protected BlockStatement`
  `createBlockStatementForConstructor(ClosureExpression expression, ClassNode outerClass, ClassNode thisClassNode)`
  `protected ClassNode`
  `createClosureClass(ClosureExpression expression, int modifiers)`
  `protected Parameter[]`
  `getClosureSharedVariables(ClosureExpression expression)`
  `ClassNode`
  `getOrAddClosureClass(ClosureExpression expression, int modifiers)`
  `static void`
  `loadReference(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 String OUTER_INSTANCE
    See Also:
      - Constant Field Values

  - ### THIS_OBJECT

    public static final 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(String name, WriterController controller)

  - ### getOrAddClosureClass

    public ClassNode getOrAddClosureClass(ClosureExpression expression, int modifiers)

  - ### createClosureClass

    protected ClassNode createClosureClass(ClosureExpression expression, int modifiers)

  - ### addSerialVersionUIDField

    protected void addSerialVersionUIDField(ClassNode classNode)

  - ### addConstructor

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

  - ### addFieldsForLocalVariables

    protected void addFieldsForLocalVariables(InnerClassNode closureClass, 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 expression)

  - ### loadThis

    protected void loadThis()