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

org.chobit.commons.validation.CommonPattern Maven / Gradle / Ivy

There is a newer version: 0.1.3.4
Show newest version
package org.chobit.commons.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.chobit.commons.enums.CommonRegexPattern;

import java.lang.annotation.*;

/**
 * 通用正则校验注解
 *
 * @author robin
 */
@Documented
@Constraint(
        validatedBy = {CommonPatternValidator.class}
)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface CommonPattern {


    Class[] groups() default {};


    Class[] payload() default {};


    /**
     * 正则表达式
     *
     * @return 正则表达式
     */
    CommonRegexPattern pattern();

    /**
     * 提示消息
     *
     * @return 提示消息
     */
    String message() default "不能通过正则校验";


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy