@Target
是原注解,用来修饰注解的作用范围,可选择的值以数组的形式传入,ElementType[] value();
ElementType
枚举的值有
public enum ElementType {
/** Class, interface (including annotation type), or enum declaration */
/** 用于描述类、接口(包括注解类型)或enum声明*/
TYPE,
/** Field declaration (includes enum constants) */
/** 用于描述域 (包括enum常量)*/
FIELD,
/** Method declaration */
/** 用于描述方法 */
METHOD,
/** Formal parameter declaration */
/** 用于描述参数 */
PARAMETER,
/** Constructor declaration */
/** 用于描述构造器 */
CONSTRUCTOR,
/** Local variable declaration */
/** 用于描述局部变量 */
LOCAL_VARIABLE,
/** Annotation type declaration */
/** 用于描述注解 */
ANNOTATION_TYPE,
/** Package declaration */
/** 用于描述包 */
PACKAGE,
/**
* Type parameter declaration
* 用于描述参数类型
* @since 1.8
*/
TYPE_PARAMETER,
/**
* Use of a type
*类型的使用
* @since 1.8
*/
TYPE_USE
}