All Downloads are FREE. Search and download functionalities are using the official Maven repository.

plus.jdk.ananotaions.ValidationRule Maven / Gradle / Ivy

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 validator() default DefaultValidator.class;

    /**
     * 验证器输入参数
     */
    String args() default "";

    /**
     * 是否为必填的值
     */
    boolean required() default false;

    /**
     * 指定错误信息
     */
    String message() default "invalid params";
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy