Accessing type annotations via annotation processor

Gunnar Morling gunnar at
Mon Aug 11 10:22:11 UTC 2014


I'm looking for a way to obtain annotations given on type uses using a JSR
269 annotation processor.

E.g. I'd like to obtain the @NotNull annotation from the following field

    private List<@NotNull String> values;

Based on a post of Joe [1] I assumed this to be possible, but a discussion
on this list now makes me believe this cannot be done as of Java 8. Is this
true? If so, will this be the case in SE 9?

On a tangent, Joe referenced a diff of the JavaDocs of two versions of the
JSR 269 API, containing nicely colored mark-up highlighting the changes.
What's the tool used for creating this diff?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list