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 WriterController
controller
static String
OUTER_INSTANCE
static 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(String name, WriterController controller)
protected void
loadThis()
protected static void
removeInitialValues(Parameter[] params)
void
writeClosure(ClosureExpression expression)
-
Field Details
-
OUTER_INSTANCE
- See Also:
- Constant Field Values
-
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()
-