@Repeatable 注解作用
发布于: 2021 年 01 月 08 日
jdk1.8 开始实现的,详细请看源码
/** * The annotation type {@code java.lang.annotation.Repeatable} is * used to indicate that the annotation type whose declaration it * (meta-)annotates is <em>repeatable</em>. The value of * {@code @Repeatable} indicates the <em>containing annotation * type</em> for the repeatable annotation type. * * @since 1.8 * @jls 9.6 Annotation Types * @jls 9.7 Annotations */@Documented@Retention(RetentionPolicy.RUNTIME)@Target(ElementType.ANNOTATION_TYPE)public @interface Repeatable { /** * Indicates the <em>containing annotation type</em> for the * repeatable annotation type. * @return the containing annotation type */ Class<? extends Annotation> value();}复制代码
@Target(ElementType.ANNOTATION_TYPE) 表明是作用在"注解"上的一个注解,表示作用的这个注解可以在目标上重复使用。
划线
评论
复制
发布于: 2021 年 01 月 08 日阅读数: 17
张健
关注
还未添加个人签名 2018.04.20 加入
还未添加个人简介











评论