I\'m trying to create an annotation for a local variable. I know that I can\'t retain the annotation in the generated bytecode, but I should be able to have access to the in
As of Java 8, local variable annotations are stored in the classfile.
A standard Java annotation processor does not process the bodies of methods. However, the Checker Framework enables you to write an annotation processor that processes every annotation including on local variables. Its annotation processors can even examine every statement of the program, whether annotated or not.