Example usage for org.apache.commons.beanutils WrapDynaBean get

List of usage examples for org.apache.commons.beanutils WrapDynaBean get

Introduction

In this page you can find the example usage for org.apache.commons.beanutils WrapDynaBean get.

Prototype

public Object get(String name) 

Source Link

Document

Return the value of a simple property with the specified name.

Usage

From source file:org.latticesoft.util.resource.dao.Param.java

/**
 * @see #prepare(Object, PreparedStatement)
 * @exception throws SQLException//from ww  w.  ja va 2s  .  c om
 */
public void prepareEx(Object o, PreparedStatement pstmt) throws SQLException {
    Object param = null;
    if (o instanceof WrapDynaBean) {
        WrapDynaBean bean = (WrapDynaBean) o;
        param = bean.get(this.getAttribute());
    } else if (o instanceof Map) {
        Map map = (Map) o;
        param = map.get(this.getAttribute());
    } else {
        WrapDynaBean bean = new WrapDynaBean(o);
        param = bean.get(this.getAttribute());
    }
    this.setValueToStatement(param, pstmt);
}