I know there are three retention policies for Java annotations:
CLASS: Annotations are to be recorded in the class file by the compiler but need not be re
Retention policy SOURCE is to aid IDEs, compilers and possibly code/doc generators to take advantage of annotations. These annotation do not make up part of compiled class and are discarded by compiler so not available during runtime.
For example, annotation java.lang.SuppressWarnings
tells compiler not to report certain warnings.
Annotations to generate documentation can be of retention policy SOURCE.
Take a look at this post/answer Annotation SOURCE Retention Policy