I can create a processor using Reflection to process the run-time level annotations, but how can i process the source level annotations using reflection?
1 Answer
As the RetentionPolicy APIdoc states:
SOURCE
Annotations are to be discarded by the compiler.
So the answer is no. You either process annotation with @Retention(SOURCE) at compile time or they vanish.
If you process them at compile time implementing an AbstractProcessor and registring it via system properties or configuration of maven-compiler-plugin to the compiler is the usual way.
AbstractProcessor?