jtr.assigner.util
Class BeanUtilsExtension
java.lang.Object
jtr.assigner.util.BeanUtilsExtension
public class BeanUtilsExtension
- extends java.lang.Object
This class extends the BeanUtils.setProperty(Object,String,Object) method
in a way that accessing and writing private fields becomes possible without the need to
leverage on setter methods.
- Since:
- 4.0
- Version:
- 3.1
- Author:
- Francesco Russo (frusso@dev.java.net)
|
Method Summary |
static void |
setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
This method sets over the bean instance's property identified by
name, the provided value value.
First of all the method tries find the property amongst those defined by the
class or by its super-class and tries to set it directly (even if the property
is not public).
Should this not work, a public setter is searched for and used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanUtilsExtension
public BeanUtilsExtension()
setProperty
public static void setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
- This method sets over the
bean instance's property identified by
name, the provided value value.
First of all the method tries find the property amongst those defined by the
class or by its super-class and tries to set it directly (even if the property
is not public).
Should this not work, a public setter is searched for and used.
This method might throw a ParameterException should it be unpossible
accessing the property.
- Parameters:
bean - The target beanname - The target bean's propertyvalue - The value to be set