@GroovyASTTransformation(phase = CompilePhase.CONVERSION)
public class AutoImplementASTStubber
extends AbstractASTTransformation
Joint-compilation stubber for AutoImplement. Emits placeholder implementations of abstract methods reachable through the supertype and interface graph, so Java consumers can call those methods against the joint-compilation stub.
The walk mirrors the full transform's AutoImplementASTTransformation.getAllCorrectedMethodsMap: classpath supertypes/interfaces are fully resolved at CONVERSION; same-unit Groovy supertypes/interfaces have their source-declared abstracts visible too.
Boundary. Abstract methods contributed by another transform
to a same-unit Groovy supertype/interface (most notably trait
abstracts, since TraitASTTransformation runs at CANONICALIZATION
after this stubber) are not visible at CONVERSION and therefore not stubbed.
The runtime still implements them; only the Java-visible stub surface is
reduced. Java callers that reach for those members get a stub-time compile
error rather than a stub/runtime mismatch.
The placeholder body is a default-value return; the real body is
installed by the full transform at CANONICALIZATION, which first discards
stubber-tagged placeholders so the walk over isAbstract() candidates
sees the true abstract surface again.
| Fields inherited from class | Fields |
|---|---|
class AbstractASTTransformation |
RETENTION_CLASSNODE, sourceUnit |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
visit(ASTNode[] nodes, SourceUnit source) |