Java Annotations - looking for an example of RetentionPolicy.CLASS

后端 未结 4 1362
后悔当初
后悔当初 2020-12-14 16:56

according to Java Annotation API:

  • RetentionPolicy.CLASS Annotations are to be recorded in the class file by the compiler but nee

4条回答
  •  悲哀的现实
    2020-12-14 17:26

    CLASS Annotations are used in obfuscator tools like http://proguard.sourceforge.net . For example annotation @KeepName disables name mangling when you need to have your class name unchanged to be able to call methods like Class.forName().

提交回复
热议问题