https://www.jianshu.com/p/e31c20c04e8e
我在看@Empty注解的时候看到有这样的操作:
public @interface NotEmpty { String message() default "{org.hibernate.validator.constraints.NotEmpty.message}"; Class<?>[] groups() default { }; Class<? extends Payload>[] payload() default { }; /** * Defines several {@code @NotEmpty} annotations on the same element. */ @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE }) @Retention(RUNTIME) @Documented public @interface List { NotEmpty[] value(); } }
就是注解内的注解
至于用法链接里说的比较清楚了
但是我还是不明白为什么要这么写
如果要写重复的注解的话, 可以使用@Repetable呀
如果有知道的朋友,可以留个言吗?(佛系)