Home
Examples
Tutorials
Errata
/validator/Max.java
/validator/Max.java
package validator; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import javax.validation.Constraint; @Constraint(validatedBy = MaxValidator.class) @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Max { public double value() default Double.MAX_VALUE; String message() default "cannot be greater than {value}"; }
Contact the author