The question tells it all.
For the experts, is there a reason the SUN java 5 compiler accepts recursive annotations (contrary to the langspec), while the later compilers do not? I mean, what could be an argument against recursive annotations.
Edit: a recursive annotation is something like:
@Panel(layout=BorderLayout.class, nested={ @Panel(region=NORTH, layout=FlowLayout.class, ...) @Panel(region=SOUTH, layout=FlowLayout.class, ...) } )
First — I’m not sure what you mean by recursive annotations. Do you mean annotations that can contain references to other annotations of the same type? Something like
(which would be an example of where I’d like to use it if it were possible…)
As for my use of custom annotations (and processors): code generation.
See http://code.google.com/p/javadude/wiki/Annotations
For example, JavaBean properties:
or a mix-in example
See The drawbacks of annotation processing in Java? and my answer to it for some potential issues with their usage.