类 DirectFieldAccessor
public class DirectFieldAccessor extends AbstractNestablePropertyAccessor
ConfigurablePropertyAccessor
implementation that directly accesses instance fields. Allows for direct binding to fields instead of going through JavaBean setters.As of Spring 4.2, the vast majority of the
BeanWrapper
features have been merged toAbstractPropertyAccessor
, which means that property traversal as well as collections and map access is now supported here as well.A DirectFieldAccessor's default for the "extractOldValueForEditor" setting is "true", since a field can always be read without side effects.
- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller, Stephane Nicoll
- 另请参阅:
AbstractPropertyAccessor.setExtractOldValueForEditor(boolean)
,BeanWrapper
,DirectFieldBindingResult
,DataBinder.initDirectFieldAccess()
嵌套类概要
从类继承的嵌套类/接口 org.springframework.beans.AbstractNestablePropertyAccessor
AbstractNestablePropertyAccessor.PropertyHandler, AbstractNestablePropertyAccessor.PropertyTokenHolder
字段概要
从接口继承的字段 org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
构造器概要
构造器 限定符 构造器 说明 DirectFieldAccessor(Object object)
Create a new DirectFieldAccessor for the given object.protected
DirectFieldAccessor(Object object, String nestedPath, DirectFieldAccessor parent)
Create a new DirectFieldAccessor for the given object, registering a nested path that the object is in.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected NotWritablePropertyException
createNotWritablePropertyException(String propertyName)
Create aNotWritablePropertyException
for the specified property.protected org.springframework.beans.DirectFieldAccessor.FieldPropertyHandler
getLocalPropertyHandler(String propertyName)
Return aAbstractNestablePropertyAccessor.PropertyHandler
for the specified localpropertyName
.protected DirectFieldAccessor
newNestedPropertyAccessor(Object object, String nestedPath)
Create a new nested property accessor instance.从类继承的方法 org.springframework.beans.AbstractNestablePropertyAccessor
convertForProperty, getAutoGrowCollectionLimit, getFinalPath, getNestedPath, getPropertyAccessorForPropertyPath, getPropertyHandler, getPropertyType, getPropertyTypeDescriptor, getPropertyValue, getPropertyValue, getRootClass, getRootInstance, getWrappedClass, getWrappedInstance, isReadableProperty, isWritableProperty, setAutoGrowCollectionLimit, setPropertyValue, setPropertyValue, setPropertyValue, setWrappedInstance, setWrappedInstance, toString
从类继承的方法 org.springframework.beans.AbstractPropertyAccessor
isAutoGrowNestedPaths, isExtractOldValueForEditor, setAutoGrowNestedPaths, setExtractOldValueForEditor, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
从类继承的方法 org.springframework.beans.TypeConverterSupport
convertIfNecessary, convertIfNecessary, convertIfNecessary
从类继承的方法 org.springframework.beans.PropertyEditorRegistrySupport
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, overrideDefaultEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, setConversionService, useConfigValueEditors
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.beans.ConfigurablePropertyAccessor
getConversionService, setConversionService
从接口继承的方法 org.springframework.beans.PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditor
从接口继承的方法 org.springframework.beans.TypeConverter
convertIfNecessary, convertIfNecessary, convertIfNecessary
构造器详细资料
DirectFieldAccessor
public DirectFieldAccessor(Object object)
Create a new DirectFieldAccessor for the given object.- 参数:
object
- the object wrapped by this DirectFieldAccessor
DirectFieldAccessor
protected DirectFieldAccessor(Object object, String nestedPath, DirectFieldAccessor parent)
Create a new DirectFieldAccessor for the given object, registering a nested path that the object is in.- 参数:
object
- the object wrapped by this DirectFieldAccessornestedPath
- the nested path of the objectparent
- the containing DirectFieldAccessor (must not benull
)
方法详细资料
getLocalPropertyHandler
protected org.springframework.beans.DirectFieldAccessor.FieldPropertyHandler getLocalPropertyHandler(String propertyName)
从类复制的说明:AbstractNestablePropertyAccessor
Return aAbstractNestablePropertyAccessor.PropertyHandler
for the specified localpropertyName
. Only used to reach a property available in the current context.- 指定者:
getLocalPropertyHandler
在类中AbstractNestablePropertyAccessor
- 参数:
propertyName
- the name of a local property- 返回:
- the handler for that property or
null
if it has not been found
newNestedPropertyAccessor
protected DirectFieldAccessor newNestedPropertyAccessor(Object object, String nestedPath)
从类复制的说明:AbstractNestablePropertyAccessor
Create a new nested property accessor instance. Can be overridden in subclasses to create a PropertyAccessor subclass.- 指定者:
newNestedPropertyAccessor
在类中AbstractNestablePropertyAccessor
- 参数:
object
- object wrapped by this PropertyAccessornestedPath
- the nested path of the object- 返回:
- the nested PropertyAccessor instance
createNotWritablePropertyException
protected NotWritablePropertyException createNotWritablePropertyException(String propertyName)
从类复制的说明:AbstractNestablePropertyAccessor
Create aNotWritablePropertyException
for the specified property.