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
-
-
Constructor Details
-
ClosureWriter
-
-
Method Details
-
writeClosure
-
loadReference
-
getOrAddClosureClass
-
createClosureClass
-
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
-
addGeneratedClosureConstructorCall
-
loadThis
protected void loadThis()
-