[JSR308] Runtime access to JSR-308 annotations
david.goodenough at linkchoose.co.uk
Tue Sep 16 08:34:26 EDT 2008
I am new to this list, and I could not find anything about this when
scanning the archives.
I have a need to find the annotations that apply to an object (or rather to
the definition of that object, rather than finding the annotations that apply
to named methods/classes/packages/fields.
Looking at JSR-308 I see that you have now extended annotations to places
that are not methods/classes/packages/fields, such as local variables which
are not fields in classes.
Reading the JSR-308 document (java-annotation-design.pdf) section C.3 only
extends the run time annotation only in minor ways, which does not really
seem to reflect (sorry) the other additions you have made with this JSR.
I suppose what is needed is a getAnnotation method on Object which would
find the annotation on wherever this object came from. Alternatively I need a
means to get back to the field/parameter etc that this object came from.
Has any thought been given to how this might be addresses?
More information about the JSR308