元注解

package 反射与注解;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.lang.annotation.*;

public class 元注解 {
}

//Target 是表示注解是在哪些地方被使用 可以是类 可以是方法 可以是数据类型,本身数据ElementType是一个数组可以存入多个内容分
@Target(value = {ElementType.METHOD, ElementType.TYPE})

//Retention 表示注解在什么时候有效 RUNTIME>CLASS>SOURCE
@Retention(value = RetentionPolicy.RUNTIME)
//Documented 表示生成的javadoc是否存在
@Documented
//Inherited 表示子类是否继承注解
@Inherited
@interface MyAnnotation {
   
}
原文地址:https://www.cnblogs.com/wooroc/p/15810914.html