Example usage for org.apache.commons.beanutils DynaBean getClass

List of usage examples for org.apache.commons.beanutils DynaBean getClass

Introduction

In this page you can find the example usage for org.apache.commons.beanutils DynaBean getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDynaBeanImpl.java

public void set(Object anObject, Object aValue) throws MetadataException {
    if (anObject == null)
        return;//  w ww.j  a va2 s.  com
    if (anObject instanceof DynaBean) {
        DynaBean dynaBean = (DynaBean) anObject;
        try {
            dynaBean.set(getName(), aValue);
        } catch (Throwable t) {
            String msg = dynaBean.getClass().getName();
            logSetProblem(anObject, aValue, msg);
            throw new PersistenceBrokerException(t);
        }
    } else {
        String msg = "the object is not a DynaBean";
        logSetProblem(anObject, aValue, msg);
        throw new PersistenceBrokerException(msg);
    }
}

From source file:org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDynaBeanImpl.java

public Object get(Object anObject) throws MetadataException {
    if (anObject == null)
        return null;
    if (anObject instanceof DynaBean) {
        DynaBean dynaBean = (DynaBean) anObject;
        try {//from w w w.j  a v  a  2  s.c  o m
            return dynaBean.get(getName());
        } catch (Throwable t) {
            String msg = dynaBean.getClass().getName();
            logGetProblem(anObject, msg);
            throw new PersistenceBrokerException(t);
        }
    } else {
        String msg = "the object is not a DynaBean";
        logGetProblem(anObject, msg);
        throw new PersistenceBrokerException(msg);
    }
}