Java注解-元注解
元注解 @Retention public @interface Retention { /** * Returns the retention policy. * @return the retention policy */ RetentionPolicy value(); } 此注解表明了注解的生命周期 public enum RetentionPolicy { /** * Annotations are to be discarded by the compiler. */ SOURCE, /** * Annotations are to be recorded in the class file by the compiler * but need not be retained by the VM at run time. This is the default * behavior. */ CLASS, /** * Annotations are to be recorded in the class file by the compiler and * retained by the VM at run time, so they may be read reflectively. * * @see java.lang.reflect.AnnotatedElement */ RUNTIME } 有三种,分别是源代码、字节码、和运行时 ...