public class StaticTypesClosureWriter
extends ClosureWriter
Writer responsible for generating closure classes in statically compiled mode.
| Fields inherited from class | Fields |
|---|---|
class ClosureWriter |
GENERATED_CLOSURE_CLASS, OUTER_INSTANCE, PACKED_METHOD_PREFIX, THIS_OBJECT, controller |
| Constructor and description |
|---|
StaticTypesClosureWriter(WriterController wc)Creates a closure writer for statically compiled code generation. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected ClassNode |
createClosureClass(ClosureExpression expression, int mods)* Creates a new inner class node representing the compiled form of a closure expression. * *
|
|
protected boolean |
hoistedBodyUsesReceiver(ClosureExpression expression)Whether the body, nested closures included, uses its this object: this, an instance
field or property, an implicit-this call of an instance method, or the creation of an inner
class instance, which passes this as its enclosing instance (an instance of a static
nested class takes none). |
|
protected boolean |
isPackTriggered(ClosureExpression expression, boolean annotated) |
|
protected void |
markHoistedBody(MethodNode hoisted) |
|
protected boolean |
packedClosureUsesDelegateGuard() |
|
protected ClassNode |
readOnlyCaptureType(String name, ClassNode declaredType, Variable variable) |
|
protected String |
triggerDeclineReason(ClosureExpression expression) |
Creates a closure writer for statically compiled code generation.
* Creates a new inner class node representing the compiled form of a closure expression. * *
expression - the closure expression to compile
*modifiers - the access modifiers for the generated class
* Whether the body, nested closures included, uses its this object: this, an instance
field or property, an implicit-this call of an instance method, or the creation of an inner
class instance, which passes this as its enclosing instance (an instance of a static
nested class takes none). A closure class casts getThisObject() to the enclosing
class for these, except for the methods of Object, which it calls on the uncast this
object; those count too, as the hoisted body can only call them on an instance of the
enclosing class. Static members and extension methods (the println family) do not
count.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.