Class TraitComposer
- java.lang.Object
- 
- org.codehaus.groovy.transform.trait.TraitComposer
 
- 
 public abstract class TraitComposer extends java.lang.ObjectThis class contains a static utility methoddoExtendTraits(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.- Since:
- 2.3.0
 
- 
- 
Field SummaryFields Modifier and Type Field Description static ClassNodeCOMPILESTATIC_CLASSNODE
 - 
Constructor SummaryConstructors Constructor Description TraitComposer()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddoExtendTraits(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.
 
- 
- 
- 
Field Detail- 
COMPILESTATIC_CLASSNODEpublic static final ClassNode COMPILESTATIC_CLASSNODE 
 
- 
 - 
Method Detail- 
doExtendTraitspublic 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
 
 
- 
 
-