Package org.aoju.bus.validate.annotation
Annotation Interface Reflect
@Documented
@Retention(RUNTIME)
@Target({ANNOTATION_TYPE,METHOD,PARAMETER,FIELD})
@Complex(value="Reflect",
clazz=ReflectStrategy.class)
public @interface Reflect
通过反射调用被校验参数,并判断反射方法的结果
默认被校验对象是null时,通过校验
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
target
Class<?> target反射要执行的类- Returns:
- the object
-
method
String method反射要执行的方法- Returns:
- the string
-
validator
String[] validator校验器名称数组,将会校验反射的执行结果- Returns:
- the array
- Default:
{}
-
errcode
String errcode默认使用的异常码- Returns:
- the string
- Default:
"-1"
-
errmsg
String errmsg默认使用的异常信息- Returns:
- the string
- Default:
"${field}\u53c2\u6570\u6821\u9a8c\u5931\u8d25"
-
group
String[] group校验器组- Returns:
- the array
- Default:
{}
-
field
String field被校验字段名称- Returns:
- the string
- Default:
"field"
-