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

com.github.fashionbrot.annotation.IdCard Maven / Gradle / Ivy

The newest version!
package com.github.fashionbrot.annotation;



import java.lang.annotation.*;

/**
 * 验证身份证
 * String
 * CharSequence
 */
@Documented
@Target({ElementType.FIELD,  ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface IdCard {

    String regexp() default "(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx])|([1−9]\\d5\\d2((0[1−9])|(10|11|12))(([0−2][1−9])|10|20|30|31)\\d2[0−9Xx])";

    String msg() default "${validated.IdCard.msg}";

    /**
     * 是否跳过空值
     * @return boolean
     */
    boolean skipEmpty() default false;

    /**
     * default @see com.github.fashionbrot.groups.DefaultGroup
     * @return groups
     */
    Class[] groups() default  {};

    /**
     * ognl expression
     * @return String
     */
    String expression() default "";
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy