All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.frameworkset.util.DirectFieldAccessor Maven / Gradle / Ivy

Go to download

bboss is a j2ee framework include aop/ioc,mvc,persistent,taglib,rpc,event ,bean-xml serializable and so on.http://www.bbossgroups.com

There is a newer version: 6.2.5
Show newest version
package org.frameworkset.util;

import org.frameworkset.util.ClassUtil.ClassInfo;
import org.frameworkset.util.beans.BeanWrapper;

/**
 * {@link ConfigurablePropertyAccessor} implementation that directly accesses
 * instance fields. Allows for direct binding to fields instead of going through
 * JavaBean setters.
 *
 * 

As of Spring 4.2, the vast majority of the {@link BeanWrapper} features have * been merged to {@link AbstractPropertyAccessor}, which means that property * traversal as well as collections and map access is now supported here as well. * *

A DirectFieldAccessor's default for the "extractOldValueForEditor" setting * is "true", since a field can always be read without side effects. * * @author Juergen Hoeller * @author Stephane Nicoll * @since 2.0 * @see #setExtractOldValueForEditor * @see BeanWrapper */ public class DirectFieldAccessor { /** The wrapped object */ private Object object; private ClassInfo classInfo; public DirectFieldAccessor(Object object) { this.object = object; classInfo = ClassUtil.getClassInfo(object.getClass()); } public Object getPropertyValue(String propertyName) { return classInfo.getPropertyValue(object, propertyName); } public void setPropertyValue(String propertyName,Object value) { classInfo.setPropertyValue(object, propertyName,value); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy