I am trying to do some Java annotation magic. I must say I am still catching up on annotation tricks and that certain things are still not quite clear to me.
So... I hav
You can also absolutely stupidly (but simply) create a dummy annotation target and get it from there
@MyAnnotation(foo="bar", baz=Blah.class)
private static class Dummy {}
And
final MyAnnotation annotation = Dummy.class.getAnnotation(MyAnnotation.class)
Creating method/parameter targeted annotation instances may be a little more elaborate, but this approach has the benefit of getting the annotation instance as the JVM would normally do. Needless to say it is as simple as it can get.