类 BulkAccessor
- java.lang.Object
-
- org.hibernate.bytecode.internal.javassist.BulkAccessor
-
- 所有已实现的接口:
Serializable
public abstract class BulkAccessor extends Object implements Serializable
A JavaBean bulk accessor, which provides methods capable of getting/setting multiple properties of a JavaBean at once. IMPORTANT NOTE!!! Apparently the order of the methods here is important as I think BulkAccessorFactory makes use of that information in terms of accessing the constructor. Anyway, when I tried to re-arrange them the BulkAccessor creation failed and tests started to fail.- 作者:
- Muga Nishizawa, Shigeru Chiba
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 限定符 构造器 说明 protectedBulkAccessor()Protected access constructor so the generated class has access to it.
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 static BulkAccessorcreate(Class beanClass, String[] getters, String[] setters, Class[] types)Creates a new instance ofBulkAccessor.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 voidgetPropertyValues(Object bean, Object[] values)Obtains the values of properties of a given bean.String[]getSetters()Returns the getter names of the properties.abstract voidsetPropertyValues(Object bean, Object[] values)Sets properties of a given bean to specified values.
-
-
-
方法详细资料
-
getPropertyValues
public abstract void getPropertyValues(Object bean, Object[] values)
Obtains the values of properties of a given bean.- 参数:
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.- 参数:
bean- JavaBean.values- the values assinged to properties.
-
getPropertyValues
public Object[] getPropertyValues(Object bean)
Returns the values of properties of a given bean.- 参数:
bean- JavaBean.- 返回:
- The property values
-
getPropertyTypes
public Class[] getPropertyTypes()
Returns the types of properties.- 返回:
- The property types
-
getGetters
public String[] getGetters()
Returns the setter names of properties.- 返回:
- The getter names
-
getSetters
public String[] getSetters()
Returns the getter names of the properties.- 返回:
- The setter names
-
create
public static BulkAccessor create(Class beanClass, String[] getters, String[] setters, Class[] types)
Creates a new instance ofBulkAccessor. The created instance provides methods for setting/getting specified properties at once.- 参数:
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.- 返回:
- The created BulkAccessor
-
-