public class JavassistBeanPropertyFactory
extends java.lang.Object
implements cn.featherfly.common.bean.BeanPropertyFactory
动态创建指定类型指定属性对应的BeanProperty子类的工厂.
优点:默认的反射BeanProperty比动态生成的设置慢一倍,读取慢几倍.
缺点:生成大量类,占用内存空间.
| 构造器和说明 |
|---|
JavassistBeanPropertyFactory() |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> cn.featherfly.common.bean.BeanProperty<T> |
create(java.lang.Class<T> type,
java.lang.reflect.Field field,
java.lang.reflect.Method setMethod,
java.lang.reflect.Method getMethod)
动态创建指定类型指定属性对应的BeanProperty子类
|
<T> cn.featherfly.common.bean.BeanProperty<T> |
create(java.lang.Class<T> type,
java.lang.String propertyName)
动态创建指定类型指定属性对应的BeanProperty子类
|
public <T> cn.featherfly.common.bean.BeanProperty<T> create(java.lang.Class<T> type,
java.lang.reflect.Field field,
java.lang.reflect.Method setMethod,
java.lang.reflect.Method getMethod)
动态创建指定类型指定属性对应的BeanProperty子类
create 在接口中 cn.featherfly.common.bean.BeanPropertyFactorytype - 类型field - 存取数据的字段setMethod - 设置方法getMethod - 读取方法public <T> cn.featherfly.common.bean.BeanProperty<T> create(java.lang.Class<T> type,
java.lang.String propertyName)
动态创建指定类型指定属性对应的BeanProperty子类
create 在接口中 cn.featherfly.common.bean.BeanPropertyFactorytype - 类型propertyName - 属性名