weaver-hrm-salary/src/com/engine/salary/util/valid/DataCheck.java

53 lines
930 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.engine.salary.util.valid;
import java.lang.annotation.*;
/**
* 数据参数合法性注解
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DataCheck {
/**
* 是否必填
*
* @return
*/
boolean require() default false;
/**
* 参数类型
*
* @return
*/
ValidTypeEnum type() default ValidTypeEnum.STRING;
/**
* 日期格式(校验String格式的字符是否为日期格式)
*
* @return
*/
String pattern() default "yyyy-MM-dd";
/**
* 最大String字段验证文本长度int字段验证大小
*
* @return
*/
int max() default -1;
/**
* 最小String字段验证文本长度int字段验证大小
*
* @return
*/
int min() default -1;
//错误信息
int labelId() default -1;
String message();
}