public class TraitASTTransformation
extends AbstractASTTransformation
implements CompilationUnitAware
Handles generation of code for the traits (trait keyword is equivalent to using the
| Modifiers | Name | Description |
|---|---|---|
static String |
DO_DYNAMIC |
Metadata key that marks trait-generated calls requiring dynamic dispatch. |
static String |
FIELD_ASSIGNMENT |
Metadata key that marks the cast applied to a value written to a trait field, which type checking treats as an assignment to the field. |
static String |
POST_TYPECHECKING_REPLACEMENT |
Metadata key that stores an expression replacement to apply after type checking. |
| Fields inherited from class | Fields |
|---|---|
class AbstractASTTransformation |
RETENTION_CLASSNODE, sourceUnit |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
setCompilationUnit(CompilationUnit unit)Stores the compilation unit so generated helper classes can register follow-up transformations. |
|
public void |
visit(ASTNode[] nodes, SourceUnit source)Rewrites a trait declaration into the interface and helper classes used during compilation. |
Metadata key that marks trait-generated calls requiring dynamic dispatch.
Metadata key that marks the cast applied to a value written to a trait field, which type checking treats as an assignment to the field.
Metadata key that stores an expression replacement to apply after type checking.
Stores the compilation unit so generated helper classes can register follow-up transformations.
unit - the active compilation unitRewrites a trait declaration into the interface and helper classes used during compilation.
nodes - the annotation and annotated nodes participating in the transformationsource - the source unit being transformed