01: /*
02: * JFox - The most lightweight Java EE Application Server!
03: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
04: *
05: * JFox is licenced and re-distributable under GNU LGPL.
06: */
07: package org.jfox.mvc.validate;
08:
09: import java.lang.annotation.ElementType;
10: import java.lang.annotation.Retention;
11: import java.lang.annotation.RetentionPolicy;
12: import java.lang.annotation.Target;
13:
14: /**
15: * å—符串验è¯? Annotation
16: * @author <a href="mailto:jfox.young@gmail.com">Yang Yong</a>
17: */
18: @Retention(RetentionPolicy.RUNTIME)
19: @Target(ElementType.FIELD)
20: public @interface StringValidation {
21:
22: /**
23: * default String validator class
24: */
25: Class<? extends Validator> validatorClass() default StringValidator.class;
26:
27: /**
28: * 最�长度
29: */
30: int minLength() default Integer.MIN_VALUE;
31:
32: /**
33: * 最大长度
34: */
35: int maxLength() default Integer.MAX_VALUE;
36:
37: /**
38: * 是��以为空
39: */
40: boolean nullable() default false;
41:
42: //TODO: 检查æ£åˆ™è¡¨è¾¾å¼?
43: String regexp() default "";
44: }
|