cn.allbs.hj212.validator.ValueRange Maven / Gradle / Ivy
package cn.allbs.hj212.validator;
import cn.allbs.hj212.validator.field.ValidDateValidator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* @author ChenQi
*/
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Repeatable(ValueRange.List.class)
@Constraint(validatedBy = ValidDateValidator.class)
public @interface ValueRange {
boolean cp() default false;
String message() default "invalid date";
Class>[] groups() default {};
Class extends Payload>[] payload() default {};
boolean optional() default false;
/**
* Defines several {@link ValueRange} annotations on the same element.
*
* @see ValueRange
*/
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Documented
@interface List {
ValueRange[] value();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy