plus.jdk.ananotaions.ValidationRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of validator-plus Show documentation
Show all versions of validator-plus Show documentation
A simple input parameter verification component
The newest version!
package plus.jdk.ananotaions;
import plus.jdk.common.IValidator;
import plus.jdk.validator.DefaultValidator;
import java.lang.annotation.*;
@Inherited
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(ValidationRules.class)
public @interface ValidationRule {
/**
* 当前规则验证类,需要实现接口对应的方法
*/
Class extends IValidator> validator() default DefaultValidator.class;
/**
* 验证器输入参数
*/
String args() default "";
/**
* 是否为必填的值
*/
boolean required() default false;
/**
* 指定错误信息
*/
String message() default "invalid params";
}