Hello,
Is it possible to add a local transformer to the Trait like this?
```groovy
@Retention(RetentionPolicy.RUNTIME)
@GroovyASTTransformationClass(["swagger.grails4.compiler.ApiDocTransformer"])
@interface ApiDoc {
String value() default ""
}
@CompileStatic
@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)
class ApiDocTransformer extends AbstractASTTransformation {
@Override
void visit(ASTNode[] nodes, SourceUnit source) {
// processing Class node it should be an Interface because trait is
transformed to Interface and some helper classes
// But The trasformer will not be triggered for Trait
}
}
@ApiDoc("My Trait")
trait MyTrait {
}
```
I have tried like this but the transformer can not be invoked for Trait.
If I add the @ApiDoc annotation to implementing class the transformer can be
invoked,
but how can I transform trait methods such as adding an annotation to getter
method?
Thanks.
Best Regards,
Bob Yang