Tuesday, February 7, 2012

Annotation with annotation element annotating itself

So... this works...
@Awesomeness(level = 100, item = @Awesomeness.Thing("Ice cream!"))
@interface Awesomeness {

   int level() default 42;

   Thing item() default @Thing("Hamburger!");

   @interface Thing {
      String value() default "Bacon!";
Now if I can only do something useful with this...

And yes, the compiler does detect cycles. Awesome!!

No comments:

Post a Comment