Features of syboos commons beanutils
2010/04/09 17:50Update
List features of syboos commons beanutils.
==What is Syboos commons beanutils:
Syboos commons beanutils is easy-to-use Java BeanUtils library with convertation and validation function.
You can use like this:
MyOrgBean.java
public class MyOrgBean {
@ValidateRequired(message="key.required")
@ValidateEmail(message="email.format.error")
private String email;
...
}
Validate
MyOrgBean org = new MyOrgBean();
org.setEmail("a@test.com.");
BeanUtils.validate(org);
then it will display a error message.
==Features:
1. the same function of Apache BeanUtils library.
2. Convertation. You can do fields convertation when copyProperties.
3. Validation. You can do fields validation when copyProperties or validate.
4. Customize the validation message by:
4.1 message key. eg:
@ValidateRequired(message="key.required") private String email;
4.2 regist a global MessageProcessor. eg:
BeanUtils.registMessageProcessor(new MyMessageProcessor());
MyMessageProcessor.java
public class MyMessageProcessor implements IMessageProcessor {
public String getMessage(String message,
Class objClass, String fieldName, Object fieldValue,
Class validatorClass, Map <String, Object>validatorArgs) {
...
}
}
5. field Processor.
6. Convert or validate with Java Annotaion or a XML file.
7. Easy-to-use.
more see samples in documentation.
==Environments:
1. Programming Language: Java (JDK1.5+)
2. OS independence.
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 - ValidateType - (2010/04/12 17:55)
- Syboos Commons BeanUtils validators - Create custom validator - (2010/04/13 18:33)
- Syboos Commons BeanUtils Converters - ConvertDateFormat - (2010/04/13 18:50)