me.aifaq.commons.lang.validation.constraints.PastExt Maven / Gradle / Ivy
/**
*
*/
package me.aifaq.commons.lang.validation.constraints;
import me.aifaq.commons.lang.validation.constraintvalidators.PastExtValidatorForCalendar;
import me.aifaq.commons.lang.validation.constraintvalidators.PastExtValidatorForDate;
import me.aifaq.commons.lang.validation.constraintvalidators.PastExtValidatorForLong;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* The annotated element must be a date whose value must be lower or equal to the specified MaxDate.
*
* Supported types are:
*
* - {@code java.util.Date}
* - {@code java.util.Calendar}
* - {@code java.sql.Date}
* - {@code java.sql.Timestamp}
* - {@code java.lang.Long}
*
*
* @author Wang Wei [[email protected]]
* @since 11:25:08 AM May 17, 2016
*/
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = { PastExtValidatorForDate.class, PastExtValidatorForCalendar.class, PastExtValidatorForLong.class })
public @interface PastExt {
String value() default "";
/**
* 是否包含目标值
*/
boolean inclusive() default true;
String message() default "{me.aifaq.validation.constraints.PastExt.message}";
Class>[] groups() default {};
Class extends Payload>[] payload() default {};
/**
* Defines several {@link PastExt} annotations on the same element.
*
* @see PastExt
*/
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
@interface List {
PastExt[] value();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy