From a Java doc:
CLASS: Annotations must be written to the class file by the compiler, but must not be saved by the VM at runtime.
RUNTIME: Annotations must be written to the class file by the compiler and saved by the VM at run time, so they can be read with reflexivity.
SOURCE: Annotations must be discarded by the compiler.
I understand the use of RUNTIME (to use reflection annotations) and CLASS (for the compiler), but I don't understand when it might be useful to use
@Retention (RetentionPolicy.SOURCE)
Can you explain?
source
share