Class DelegateASTStubber
- All Implemented Interfaces:
ASTTransformation,ErrorCollecting
Delegate. Walks the delegate type
with the same enumeration and filtering rules as the full transform —
sharing helpers from DelegateASTTransformation — and emits
placeholder methods on the owner so Java consumers can call the delegated
surface against the joint-compilation stub.
The stub surface is a strict subset of the runtime: the
stubber honours interfaces, deprecated,
includes/excludes, includeTypes/excludeTypes,
and allNames the same way the runtime does, so no method appears
on the stub that the full transform won't add at runtime.
Member-body content is a default-value placeholder; the full transform
at CANONICALIZATION discards stubber-tagged methods first, then installs
its real this.delegate.method(args) bodies.
Boundary. When the delegate type is in the same compilation unit and gains methods from another transform that runs after CONVERSION (or another CONVERSION-phase stubber that hasn't run yet — e.g. the delegate type is declared after the owner in source), those methods are not visible to the stubber and not delegated in the stub. The runtime still produces the full surface; the stub remains a subset.
- Since:
- 6.0.0
-
Field Summary
Fields inherited from class org.codehaus.groovy.transform.AbstractASTTransformation
RETENTION_CLASSNODE, sourceUnit -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvisit(ASTNode[] nodes, SourceUnit source) The method is invoked when an AST Transformation is active.Methods inherited from class org.codehaus.groovy.transform.AbstractASTTransformation
addError, checkIncludeExcludeUndefinedAware, checkIncludeExcludeUndefinedAware, checkNotInterface, checkPropertyList, checkPropertyList, checkPropertyList, copyAnnotatedNodeAnnotations, copyAnnotatedNodeAnnotations, deemedInternal, deemedInternalName, getAnnotationName, getMemberClassList, getMemberClassValue, getMemberClassValue, getMemberIntValue, getMemberStringList, getMemberStringValue, getMemberStringValue, getMemberValue, hasAnnotation, init, markAsInternal, memberHasValue, shouldSkip, shouldSkip, shouldSkip, shouldSkipOnDescriptorUndefinedAware, shouldSkipUndefinedAware, shouldSkipUndefinedAware, shouldSkipUndefinedAware, tokenize
-
Constructor Details
-
DelegateASTStubber
public DelegateASTStubber()
-
-
Method Details
-
visit
Description copied from interface:ASTTransformationThe method is invoked when an AST Transformation is active. For local transformations, it is invoked once each time the local annotation is encountered. For global transformations, it is invoked once for every source unit, which is typically a source file.- Parameters:
nodes- The ASTnodes when the call was triggered. Element 0 is the AnnotationNode that triggered this annotation to be activated. Element 1 is the AnnotatedNode decorated, such as a MethodNode or ClassNode. For global transformations it is usually safe to ignore this parameter.source- The source unit being compiled. The source unit may contain several classes. For global transformations, information about the AST can be retrieved from this object.
-