org.hibernate.bytecode.internal.javassist
Class BulkAccessor

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

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/).

See Also:
Serialized Form

Field Summary
protected  String[] getters
           
protected  String[] setters
           
protected  Class target
           
protected  Class[] types
           
 
Constructor Summary
protected BulkAccessor()
           
 
Method Summary
static BulkAccessor create(Class beanClass, String[] getters, String[] setters, Class[] types)
          Creates a new instance of BulkAccessor.
 String[] getGetters()
          Returns the setter names of properties.
 Class[] getPropertyTypes()
          Returns the types of properties.
 Object[] getPropertyValues(Object bean)
          Returns the values of properties of a given bean.
abstract  void getPropertyValues(Object bean, Object[] values)
          Obtains the values of properties of a given bean.
 String[] getSetters()
          Returns the getter names of the properties.
abstract  void setPropertyValues(Object bean, 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 Class target

getters

protected String[] getters

setters

protected String[] setters

types

protected Class[] types
Constructor Detail

BulkAccessor

protected BulkAccessor()
Method Detail

getPropertyValues

public abstract void getPropertyValues(Object bean,
                                       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(Object bean,
                                       Object[] values)
Sets properties of a given bean to specified values.

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

getPropertyValues

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

Parameters:
bean - JavaBean.

getPropertyTypes

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


getGetters

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


getSetters

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


create

public static BulkAccessor create(Class beanClass,
                                  String[] getters,
                                  String[] setters,
                                  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 © 2001-2012 Red Hat, Inc. All Rights Reserved.