FileDocCategorySizeDatePackage
BulkAccessor.javaAPI DocHibernate 3.2.52428Fri Feb 03 15:15:20 GMT 2006org.hibernate.bytecode.javassist

BulkAccessor

public abstract class BulkAccessor extends Object implements Serializable
A JavaBean accessor.

This object provides methods that set/get multiple properties of a JavaBean at once. This class and its support classes have been developed for the comaptibility with cglib (http://cglib.sourceforge.net/).

author
Muga Nishizawa
author
modified by Shigeru Chiba

Fields Summary
protected Class
target
protected String[]
getters
protected String[]
setters
protected Class[]
types
Constructors Summary
protected BulkAccessor()

	
Methods Summary
public static org.hibernate.bytecode.javassist.BulkAccessorcreate(java.lang.Class beanClass, java.lang.String[] getters, java.lang.String[] setters, java.lang.Class[] types)
Creates a new instance of BulkAccessor. The created instance provides methods for setting/getting specified properties at once.

param
beanClass the class of the JavaBeans accessed through the created object.
param
getters the names of setter methods for specified properties.
param
setters the names of getter methods for specified properties.
param
types the types of specified properties.

		BulkAccessorFactory factory = new BulkAccessorFactory( beanClass, getters, setters, types );
		return factory.create();
	
public java.lang.String[]getGetters()
Returns the setter names of properties.

		return ( String[] ) getters.clone();
	
public java.lang.Class[]getPropertyTypes()
Returns the types of properties.

		return ( Class[] ) types.clone();
	
public abstract voidgetPropertyValues(java.lang.Object bean, java.lang.Object[] values)
Obtains the values of properties of a given bean.

param
bean JavaBean.
param
values the obtained values are stored in this array.

public java.lang.Object[]getPropertyValues(java.lang.Object bean)
Returns the values of properties of a given bean.

param
bean JavaBean.

		Object[] values = new Object[getters.length];
		getPropertyValues( bean, values );
		return values;
	
public java.lang.String[]getSetters()
Returns the getter names of the properties.

		return ( String[] ) setters.clone();
	
public abstract voidsetPropertyValues(java.lang.Object bean, java.lang.Object[] values)
Sets properties of a given bean to specified values.

param
bean JavaBean.
param
values the values assinged to properties.