Example usage for org.apache.commons.beanutils BeanMap setBean

List of usage examples for org.apache.commons.beanutils BeanMap setBean

Introduction

In this page you can find the example usage for org.apache.commons.beanutils BeanMap setBean.

Prototype

public void setBean(Object newBean) 

Source Link

Document

Sets the bean to be operated on by this map.

Usage

From source file:org.hsweb.web.service.impl.form.validator.java.JavaDycBeanValidator.java

@Override
public boolean validate(Object data, Operation operation) throws ValidationException {
    if (data instanceof Map)
        return validateMap(((Map) data), operation);
    if (data instanceof Collection) {
        for (Object o : ((Collection) data)) {
            validate(o, operation);//  ww w . j av a  2  s.  co  m
        }
    } else {
        BeanMap beanMap = new BeanMap();
        beanMap.setBean(data);
        validateMap(beanMap, operation);
    }
    return true;
}