Summary SOURCE Storage Policy

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?

+24
source share
2 answers

, @SuppressWarnings, @Override - , - . RetentionPolicy.SOURCE . , ( Spring ROO) - .

+19

- fooobar.com/questions/8934207/....

, . . @SuppressWarnings

, , , . . -Spring Roo.

0

All Articles