KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > validator > Length


1 //$Id: Length.java,v 1.1 2005/05/27 08:58:53 epbernard Exp $
2
package org.hibernate.validator;
3
4 import static java.lang.annotation.ElementType.METHOD JavaDoc;
5 import static java.lang.annotation.RetentionPolicy.RUNTIME JavaDoc;
6
7 import java.lang.annotation.Retention JavaDoc;
8 import java.lang.annotation.Target JavaDoc;
9
10 /**
11  * Apply some length restrictions to the annotated element. It has to be a string
12  * @author Gavin King
13  */

14 @ValidatorClass(LengthValidator.class)
15 @Target JavaDoc(METHOD) @Retention JavaDoc(RUNTIME)
16 public @interface Length {
17     int max() default Integer.MAX_VALUE;
18     int min() default 0;
19     String JavaDoc message() default "length must be between {min} and {max}";
20 }
21
Popular Tags