libgdx/libgdx — pull request #2215 by code-disaster (2014-08-08 22:54:14+00:00)
Title: Proposal: annotation support in reflection wrapper

Hey ho,

with this PR it is possible to query annotation information at runtime via the reflection wrapper. It supports class and field annotations. They must be annotated with RetentionPolicy.RUNTIME to become available.

I've already finished adding wrapper functions to the non-GWT versions before I discovered the insanity that lies behind IReflectionCache...

Anyway, it seems to work now, so some of you might be interested in skim through the changes.

The ReflectionCacheSourceCreator for GWT now basically embeds and returns anonymous implementations of the annotation interfaces, fetching the values from source during compilation. I recommend to just try an example and peek at the generated code.