org.hibernate.bytecode.javassist
Class BulkAccessor

java.lang.Object
  extended by org.hibernate.bytecode.javassist.BulkAccessor
All Implemented Interfaces:
java.io.Serializable

public abstract class BulkAccessor
extends java.lang.Object
implements java.io.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, modified by Shigeru Chiba
See Also:
Serialized Form

Field Summary
protected  java.lang.String[] getters
           
protected  java.lang.String[] setters
           
protected  java.lang.Class target
           
protected  java.lang.Class[] types
           
 
Constructor Summary
protected BulkAccessor()
           
 
Method Summary
static BulkAccessor create(java.lang.Class beanClass, java.lang.String[] getters, java.lang.String[] setters, java.lang.Class[] types)
          Creates a new instance of BulkAccessor.
 java.lang.String[] getGetters()
          Returns the setter names of properties.
 java.lang.Class[] getPropertyTypes()
          Returns the types of properties.
 java.lang.Object[] getPropertyValues(java.lang.Object bean)
          Returns the values of properties of a given bean.
abstract  void getPropertyValues(java.lang.Object bean, java.lang.Object[] values)
          Obtains the values of properties of a given bean.
 java.lang.String[] getSetters()
          Returns the getter names of the properties.
abstract  void setPropertyValues(java.lang.Object bean, java.lang.Object[] values)
          Sets properties of a given bean to specified values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected java.lang.Class target

getters

protected java.lang.String[] getters

setters

protected java.lang.String[] setters

types

protected java.lang.Class[] types
Constructor Detail

BulkAccessor

protected BulkAccessor()
Method Detail

getPropertyValues

public abstract void getPropertyValues(java.lang.Object bean,
                                       java.lang.Object[] values)
Obtains the values of properties of a given bean.

Parameters:
bean - JavaBean.
values - the obtained values are stored in this array.

setPropertyValues

public abstract void setPropertyValues(java.lang.Object bean,
                                       java.lang.Object[] values)
Sets properties of a given bean to specified values.

Parameters:
bean - JavaBean.
values - the values assinged to properties.

getPropertyValues

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

Parameters:
bean - JavaBean.

getPropertyTypes

public java.lang.Class[] getPropertyTypes()
Returns the types of properties.


getGetters

public java.lang.String[] getGetters()
Returns the setter names of properties.


getSetters

public java.lang.String[] getSetters()
Returns the getter names of the properties.


create

public static BulkAccessor create(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.

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


Copyright © 2008 Hibernate.org. All Rights Reserved.