public abstract class AbstractBeanPropertyAccessor extends java.lang.Object implements PropertyAccessor
| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
AbstractBeanPropertyAccessor.PropertyHandle |
protected static class |
AbstractBeanPropertyAccessor.PropertyToken |
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
allowCollectionAutoGrow
允许array,list,set自动增长
|
protected boolean |
allowCreateHoldValueIfNull
当持有对象为null时, 是否允许创建对象
a.b 持有对象为 a
a[1][2] 持有对象为 a[1]
a[1][2].b 持有对象为 a[1][2]
|
| 构造器和说明 |
|---|
AbstractBeanPropertyAccessor() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.util.List<IndexProperty> |
getIndexPropertyValues(java.lang.String propertyName)
获取索引属性名称的路径与对应的值;
|
protected java.util.List<IndexProperty> |
getIndexPropertyValues(java.lang.String propertyName,
java.util.List<IndexProperty> indexProperties) |
java.util.Map<java.lang.String,java.lang.Object> |
getMapIndexPropertyValues(java.lang.String propertyName)
获取索引属性名称的路径与对应的值; null值会丢失
|
java.lang.String |
getNestedPath()
对象路径
|
protected abstract AbstractBeanPropertyAccessor.PropertyHandle |
getPropertyHandle(java.lang.String propertyName)
获取属性处理类
|
protected AbstractBeanPropertyAccessor.PropertyToken |
getPropertyHoldingToken(AbstractBeanPropertyAccessor.PropertyToken token)
获取token的上一级token
|
protected java.lang.Object |
getPropertyHoldingValue(AbstractBeanPropertyAccessor.PropertyToken token)
获取索引属性名称上一级的值; 如 属性名称为 a[a1][a2] 即 上一级为 a[a1]
|
protected AbstractBeanPropertyAccessor.PropertyToken |
getPropertyNameToken(java.lang.String propertyName) |
protected java.lang.Object |
getPropertyValue(AbstractBeanPropertyAccessor.PropertyToken token) |
java.lang.Object |
getPropertyValue(java.lang.String propertyName)
根据属性名称获取值
|
java.lang.Class<?> |
getRootClass()
根对象的class
|
java.lang.Object |
getRootInstance()
根对象
|
java.lang.Class<?> |
getWrappedClass()
返回包装对象的Class
|
java.lang.Object |
getWrappedInstance()
返回包装对象
|
protected abstract AbstractBeanPropertyAccessor |
newNestedPropertyAccessor(java.lang.Object object,
java.lang.String nestedPath)
构造属性寄存对象
|
protected java.util.List<IndexProperty> |
scanPropertyMapValue(java.util.List<IndexProperty> all,
java.lang.String rootPath,
java.lang.Object holdingObject,
AbstractBeanPropertyAccessor.PropertyToken token,
int keyLocation) |
void |
setAllowCollectionAutoGrow(boolean allowCollectionAutoGrow) |
void |
setAllowCreateHoldValueIfNull(boolean allowCreateHoldValueIfNull) |
protected void |
setPropertyValue(AbstractBeanPropertyAccessor.PropertyToken token,
java.lang.Object newValue) |
void |
setPropertyValue(java.lang.String propertyName,
java.lang.Object value) |
void |
setWrappedInstance(java.lang.Object object)
设置包装对象
|
void |
setWrappedInstance(java.lang.Object object,
java.lang.String nestedPath,
java.lang.Object rootObject)
设置包装对象
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisReadableProperty, isWritablePropertyprotected boolean allowCollectionAutoGrow
protected boolean allowCreateHoldValueIfNull
a.b 持有对象为 a
a[1][2] 持有对象为 a[1]
a[1][2].b 持有对象为 a[1][2]
public void setWrappedInstance(java.lang.Object object,
java.lang.String nestedPath,
java.lang.Object rootObject)
object - 待包装对象nestedPath - 包装对象在父对象中路径rootObject - 父对象public void setWrappedInstance(java.lang.Object object)
object - 待包装对象public final java.lang.Object getWrappedInstance()
public final java.lang.Class<?> getWrappedClass()
public final java.lang.String getNestedPath()
public final java.lang.Object getRootInstance()
public final java.lang.Class<?> getRootClass()
public void setAllowCollectionAutoGrow(boolean allowCollectionAutoGrow)
public void setAllowCreateHoldValueIfNull(boolean allowCreateHoldValueIfNull)
public java.lang.Object getPropertyValue(java.lang.String propertyName)
propertyName - 属性名称protected java.lang.Object getPropertyValue(AbstractBeanPropertyAccessor.PropertyToken token)
public java.util.List<IndexProperty> getIndexPropertyValues(java.lang.String propertyName)
如获取a[].b[] :
a[0]b[0]=1
a[0]b[1]=2
propertyName - 索引属性名称public java.util.Map<java.lang.String,java.lang.Object> getMapIndexPropertyValues(java.lang.String propertyName)
protected java.util.List<IndexProperty> getIndexPropertyValues(java.lang.String propertyName, java.util.List<IndexProperty> indexProperties)
protected java.util.List<IndexProperty> scanPropertyMapValue(java.util.List<IndexProperty> all, java.lang.String rootPath, java.lang.Object holdingObject, AbstractBeanPropertyAccessor.PropertyToken token, int keyLocation)
protected java.lang.Object getPropertyHoldingValue(AbstractBeanPropertyAccessor.PropertyToken token)
token - 索引属性tokenprotected AbstractBeanPropertyAccessor.PropertyToken getPropertyHoldingToken(AbstractBeanPropertyAccessor.PropertyToken token)
token - tokenpublic void setPropertyValue(java.lang.String propertyName,
java.lang.Object value)
protected void setPropertyValue(AbstractBeanPropertyAccessor.PropertyToken token, java.lang.Object newValue)
protected AbstractBeanPropertyAccessor.PropertyToken getPropertyNameToken(java.lang.String propertyName)
protected abstract AbstractBeanPropertyAccessor.PropertyHandle getPropertyHandle(java.lang.String propertyName)
protected abstract AbstractBeanPropertyAccessor newNestedPropertyAccessor(java.lang.Object object, java.lang.String nestedPath)
object - 当前对象nestedPath - 当前内嵌路径