[JSR308] Support for processing unknown annotations?

Artemus Harper subanark at gmail.com
Mon May 26 14:49:27 EDT 2008


Is there any support for processing unknown annotations?

In my case I want to allow the analysis of user provided annotations. These
annotations are state annotations that describe the state of a value, and
can be modified once a unique reference to the value is obtained.

For example I would have an annotation:
public @interface StateDescriptor { }

The user would have an annotation:
@StateDescriptor
public @inteface Initialized
{
   boolean value() default true;
   boolean pre() default true;
   boolean post() default true;
}

Then would annotate the class:
public class MyClass
{
   @Initialized(pre=false, post=true)
   public void init()
   {
   }
   @Initialized(false)
   protected void initValues()
   {
   }

   @Initialized
   public void doStuff()
   {
   }
}

Where in this case initValues cannot be called after init()

The problem is that the user could choose any annotation, but I would need
to analyze any code annotated with annotations that are annotated with
StateDescriptor.

I do not have any idea what SupportedAnnotationTypes and TypeQualifiers
annotations actually do, so I am concerned if what I want to do is feasible.
-- 
Artemus Harper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.csail.mit.edu/pipermail/jsr308/attachments/20080526/0627c31e/attachment.htm 


More information about the JSR308 mailing list