JTR 5.0 API Documentation

jtr.assigner.util
Class BeanUtilsExtension

java.lang.Object
  extended by 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)

Constructor Summary
BeanUtilsExtension()
           
 
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
 

Constructor Detail

BeanUtilsExtension

public BeanUtilsExtension()
Method Detail

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 bean
name - The target bean's property
value - The value to be set

The JTR Project is licensed under GPL version 2