@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)
public class RecordTypeASTTransformation
extends AbstractASTTransformation
implements CompilationUnitAware
Handles generation of code for the
| Fields inherited from class | Fields |
|---|---|
class AbstractASTTransformation |
RETENTION_CLASSNODE, sourceUnit |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getAnnotationName() |
|
protected GroovyClassLoader |
getTransformLoader() |
|
public static boolean |
recordNative(ClassNode node)Indicates that the given classnode is a native JVM record class. |
|
public void |
setCompilationUnit(CompilationUnit unit) |
|
public void |
visit(ASTNode[] nodes, SourceUnit source) |
|
public static boolean |
wouldBeNativeRecord(ClassNode cNode, String targetBytecode)Predicts whether cNode will be compiled as a native JVM record.
|
Indicates that the given classnode is a native JVM record class.
For classes being compiled, this will only be valid after the
RecordTypeASTTransformation transform has been invoked.
Predicts whether cNode will be compiled as a native JVM record.
Mirrors the decision logic in doProcessRecordType (presence of
@RecordBase, target bytecode >= 16, and
@RecordOptions(mode != EMULATE)) so callers running before the
transform itself fires can act on the same outcome.
The joint-compilation stub generator uses this at Phases.CONVERSION
to decide whether to emit record Foo(...) syntax. Unlike
recordNative(ClassNode), which inspects the post-transform
super class, this predicate inspects only the source-level annotations.
cNode - the candidate class nodetargetBytecode - the target bytecode level
(see CompilerConfiguration.getTargetBytecode)