Repeatable active annotations [message #1806092] |
Thu, 02 May 2019 09:46  |
Eclipse User |
|
|
|
I created an active annotation like this:
@Target(ElementType.FIELD)
@Repeatable(MyAnnos)
@Active(MyAnnoProcessor)
annotation MyAnno {
int group = 0
}
@Target(ElementType.FIELD)
annotation MyAnnos{
MyAnno [] value
}
So I can write this in code:
@MyAnno(group=0)
@MyAnno(group=1)
String myField
In my MyAnnoProcessor I've overridden the method doTransform(MutableFieldDeclaration field, extension TransformationContext context) of the class AbstractFieldProcessor.
For each field I extract all annotations of type MyAnno and create for each annotation a new method.
When I look in the generated code then the methods are duplicated i.e. it looks like for 1 field and 2 annotations the doTransform-Method is called twice.
How can I use repeatable annotations in Xtend's active annotations correctly?
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04372 seconds