[Java] Class TraitComposer
- org.codehaus.groovy.transform.trait.TraitComposer
This class contains a static utility method doExtendTraits(org.codehaus.groovy.ast.ClassNode, org.codehaus.groovy.control.SourceUnit, org.codehaus.groovy.control.CompilationUnit) aimed at generating code for a classnode implementing a trait.
- Authors:
- Cdric Champeau
- Since:
- 2.3.0
Field Summary
Modifiers | Name | Description |
---|---|---|
static ClassNode | COMPILESTATIC_CLASSNODE |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
static void |
doExtendTraits(ClassNode cNode, SourceUnit unit, CompilationUnit cu) Given a class node, if this class node implements a trait, then generate all the appropriate code which delegates calls to the trait. |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail
public static final ClassNode COMPILESTATIC_CLASSNODE
Method Detail
public static void doExtendTraits(ClassNode cNode, SourceUnit unit, CompilationUnit cu)
Given a class node, if this class node implements a trait, then generate all the appropriate code which delegates calls to the trait. It is safe to call this method on a class node which does not implement a trait.
- Parameters:
-
cNode
- a class node -
unit
- the source unit
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/org/codehaus/groovy/transform/trait/TraitComposer.html