自定义注解
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Repeatable(MyAnnotions.class)//需要使用重复注解指定容器
@Target(value={java.lang.annotation.ElementType.TYPE,java.lang.annotation.ElementType.FIELD,java.lang.annotation.ElementType.METHOD,java.lang.annotation.ElementType.PARAMETER,java.lang.annotation.ElementType.CONSTRUCTOR,java.lang.annotation.ElementType.LOCAL_VARIABLE,java.lang.annotation.ElementType.TYPE_PARAMETER})
//目标 TYPE_PARAMETER 类型注解
@Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)//生命周期
public @interface MyAnnotation {
String value()default "test01";
}import java.lang.annotation.Repeatable;