@GroovyASTTransformation(phase = CompilePhase.CONVERSION)
public class LazyASTStubber
extends AbstractASTTransformation
Joint-compilation stubber for Lazy. Aligns the stub's accessor
surface with what the full LazyASTTransformation produces at
SEMANTIC_ANALYSIS: a getter only, no setter.
How: mark the @Lazy property as final at CONVERSION. The stub
generator runs through Verifier.visitProperty, which auto-generates
a setter only when the property is neither private nor final. Marking it
final therefore suppresses setter emission in the stub. The full transform
later removes the property entirely (replacing it with a private backing
field plus an explicit getter), so the final flag does not survive into
the runtime class.
| Fields inherited from class | Fields |
|---|---|
class AbstractASTTransformation |
RETENTION_CLASSNODE, sourceUnit |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
visit(ASTNode[] nodes, SourceUnit source) |