Features of syboos commons beanutils

2010/04/09 17:50Update
TAGS: features | BeanUtils | Convertation | Convert | Validation | Validator

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.

有关作者
Syboos.jp編集長AJavaやオープンソース情報の執筆、Webサイトの開発や運営全般の業務に携わる。

Sponsored Link


Comments

用户名 (required)

Email (will not be published) (required)

URL

Evaluation