Syboos Commons BeanUtils validators - ValidateType
2010/04/12 17:55Update
ValidateType annotation and TypeValidator class.
■ValidateType Annotation
◇ Class Name: com.syboos.beanutils.annotation.ValidateType
◇ Validator Class: com.syboos.beanutils.validator.TypeValidator
◇ Properties:
1. message [optional] error message or error message key.
2. when [optional] timing or a condition for validation.
3. type java.lang.Class
◇ Usage:
By annotation
.
◇ Class Name: com.syboos.beanutils.annotation.ValidateType
◇ Validator Class: com.syboos.beanutils.validator.TypeValidator
◇ Properties:
1. message [optional] error message or error message key.
2. when [optional] timing or a condition for validation.
3. type java.lang.Class
◇ Usage:
By annotation
@ValidateType(type=com.test.MyClass.class)
private Object value;
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@ValidateType(when="login", message="Wrong type of value.", type=com.test.MyClass.class) private Object value; ...
.
Sponsored Link
Comments
- Relative Articles
- ValidateEmail in Syboos Commons BeanUtils - (2010/04/12 16:44)
- Syboos Commons BeanUtils validators - ValidateIn - (2010/04/12 17:06)
- Syboos Commons BeanUtils validators - ValidateLength - (2010/04/12 17:19)
- Syboos Commons BeanUtils validators - ValidateNumber - (2010/04/12 17:28)
- Syboos Commons BeanUtils validators - ValidateNumberRange - (2010/04/12 17:33)
- Syboos Commons BeanUtils validators - ValidateRegex - (2010/04/12 17:40)
- Syboos Commons BeanUtils validators - ValidateRequired - (2010/04/12 17:45)
- Syboos Commons BeanUtils validators - Create custom validator - (2010/04/13 18:33)
- Syboos Commons BeanUtils Converters - ConvertDateFormat - (2010/04/13 18:50)
- Syboos Commons BeanUtils Converters - ConvertString - (2010/04/13 18:57)