Re: Accessing type annotations at runtime

2014-03-13 Thread Joe Darcy
Hello, See the methods in java.lang.reflect named getAnnotedFoo which return java.lang.reflect.AnnotedType or a subinterface. -Joe On 3/13/2014 6:24 AM, Gunnar Morling wrote: Hi, Is it possible to retrieve type annotations (as defined by JSR 308) using reflection at runtime? E.g. I would

Re: Accessing type annotations at runtime

2014-03-13 Thread Gunnar Morling
Hi Joe, Thanks for the reply and hinting me the right direction! I had seen these methods but was missing the down-cast to AnnotatedParameterizedType which gives access to getAnnotatedActualTypeArguments(). In case it's helpful to others, that's what I ended up with: Field myField = ...;