提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.framework.common.validation; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.core.IntArrayValuable; |
|
4 |
|
|
5 |
import javax.validation.Constraint; |
|
6 |
import javax.validation.Payload; |
|
7 |
import java.lang.annotation.*; |
|
8 |
|
|
9 |
@Target({ |
|
10 |
ElementType.METHOD, |
|
11 |
ElementType.FIELD, |
|
12 |
ElementType.ANNOTATION_TYPE, |
|
13 |
ElementType.CONSTRUCTOR, |
|
14 |
ElementType.PARAMETER, |
|
15 |
ElementType.TYPE_USE |
|
16 |
}) |
|
17 |
@Retention(RetentionPolicy.RUNTIME) |
|
18 |
@Documented |
|
19 |
@Constraint( |
|
20 |
validatedBy = {InEnumValidator.class, InEnumCollectionValidator.class} |
|
21 |
) |
|
22 |
public @interface InEnum { |
|
23 |
|
|
24 |
/** |
|
25 |
* @return 实现 EnumValuable 接口的 |
|
26 |
*/ |
|
27 |
Class<? extends IntArrayValuable> value(); |
|
28 |
|
|
29 |
String message() default "必须在指定范围 {value}"; |
|
30 |
|
|
31 |
Class<?>[] groups() default {}; |
|
32 |
|
|
33 |
Class<? extends Payload>[] payload() default {}; |
|
34 |
|
|
35 |
} |