Top Description Fields Constructors Methods
org.springframework.beans

public abstract Class AbstractPropertyAccessor

extends TypeConverterSupport
implements ConfigurablePropertyAccessor
Class Inheritance
All Implemented Interfaces
org.springframework.beans.ConfigurablePropertyAccessor, org.springframework.beans.TypeConverter, org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.PropertyAccessor
Known Direct Subclasses
org.springframework.beans.AbstractNestablePropertyAccessor
Imports
java.util.ArrayList, .Arrays, .List, .Map, org.springframework.lang.Nullable

Abstract implementation of the PropertyAccessor interface. Provides base implementations of all convenience methods, with the implementation of actual property access left to subclasses.
Authors
Juergen Hoeller, Stephane Nicoll
Since
2.0
See Also
getPropertyValue, setPropertyValue

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
pack-priv boolean
Inherited from org.springframework.beans.TypeConverterSupport:
typeConverterDelegate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<?>
getPropertyType(String
the property to check (may be a nested path and/or an indexed/mapped property)
propertyPath
)

Overrides org.springframework.beans.PropertyEditorRegistrySupport.getPropertyType.

Implements org.springframework.beans.PropertyAccessor.getPropertyType.

Determine the property type for the specified property, either checking the property descriptor or checking the value in case of an indexed or mapped element.
public abstract Object

Returns:

the value of the property
getPropertyValue
(String
name of the property to get the value of
propertyName
)

Redeclares org.springframework.beans.PropertyAccessor.getPropertyValue.

Actually get the value of a property.
public boolean
isAutoGrowNestedPaths()

Implements org.springframework.beans.ConfigurablePropertyAccessor.isAutoGrowNestedPaths.

Return whether "auto-growing" of nested paths has been activated.
public boolean
isExtractOldValueForEditor()

Implements org.springframework.beans.ConfigurablePropertyAccessor.isExtractOldValueForEditor.

Return whether to extract the old property value when applying a property editor to a new value for a property.
public void
setAutoGrowNestedPaths(boolean autoGrowNestedPaths)

Implements org.springframework.beans.ConfigurablePropertyAccessor.setAutoGrowNestedPaths.

Set whether this instance should attempt to "auto-grow" a nested path that contains a null value.
public void
setExtractOldValueForEditor(boolean extractOldValueForEditor)

Implements org.springframework.beans.ConfigurablePropertyAccessor.setExtractOldValueForEditor.

Set whether to extract the old property value when applying a property editor to a new value for a property.
public void
setPropertyValue(PropertyValue
an object containing the new property value
pv
)

Implements org.springframework.beans.PropertyAccessor.setPropertyValue.

Set the specified value as current property value.
public abstract void
setPropertyValue(String
name of the property to set value of
propertyName
,
Object
the new value
value
)

Redeclares org.springframework.beans.PropertyAccessor.setPropertyValue.

Actually set a property value.
public void
setPropertyValues(Map<?, ?>
a Map to take properties from. Contains property value objects, keyed by property name
map
)

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

Perform a batch update from a Map.
public void
setPropertyValues(PropertyValues
a PropertyValues to set on the target object
pvs
)

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

The preferred way to perform a batch update.
public void
setPropertyValues(PropertyValues
a PropertyValues to set on the target object
pvs
,
boolean
should we ignore unknown properties (not found in the bean)
ignoreUnknown
)

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

Perform a batch update with more control over behavior.
public void
setPropertyValues(PropertyValues
a PropertyValues to set on the target object
pvs
,
boolean
should we ignore unknown properties (not found in the bean)
ignoreUnknown
,
boolean
should we ignore invalid properties (found but not accessible)
ignoreInvalid
)

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

Perform a batch update with full control over behavior.
Inherited from org.springframework.beans.TypeConverterSupport:
convertIfNecessaryconvertIfNecessaryconvertIfNecessaryconvertIfNecessary

Field Detail

autoGrowNestedPathsback to summary
private boolean autoGrowNestedPaths
extractOldValueForEditorback to summary
private boolean extractOldValueForEditor
suppressNotWritablePropertyExceptionback to summary
pack-priv boolean suppressNotWritablePropertyException

Constructor Detail

AbstractPropertyAccessorback to summary
public AbstractPropertyAccessor()

Method Detail

getPropertyTypeback to summary
public Class<?> getPropertyType(String propertyPath)

Overrides org.springframework.beans.PropertyEditorRegistrySupport.getPropertyType.

Implements org.springframework.beans.PropertyAccessor.getPropertyType.

Doc from org.springframework.beans.PropertyAccessor.getPropertyType.

Determine the property type for the specified property, either checking the property descriptor or checking the value in case of an indexed or mapped element.

Parameters
propertyPath:String

the property to check (may be a nested path and/or an indexed/mapped property)

Returns:Class<?>

the property type for the particular property, or null if not determinable

Annotations
@Override
@Nullable
getPropertyValueback to summary
public abstract Object getPropertyValue(String propertyName) throws BeansException

Redeclares org.springframework.beans.PropertyAccessor.getPropertyValue.

Actually get the value of a property.

Parameters
propertyName:String

name of the property to get the value of

Returns:Object

the value of the property

Annotations
@Override
@Nullable
Exceptions
InvalidPropertyException:
if there is no such property or if the property isn't readable
PropertyAccessException:
if the property was valid but the accessor method failed
isAutoGrowNestedPathsback to summary
public boolean isAutoGrowNestedPaths()

Implements org.springframework.beans.ConfigurablePropertyAccessor.isAutoGrowNestedPaths.

Doc from org.springframework.beans.ConfigurablePropertyAccessor.isAutoGrowNestedPaths.

Return whether "auto-growing" of nested paths has been activated.

Annotations
@Override
isExtractOldValueForEditorback to summary
public boolean isExtractOldValueForEditor()

Implements org.springframework.beans.ConfigurablePropertyAccessor.isExtractOldValueForEditor.

Doc from org.springframework.beans.ConfigurablePropertyAccessor.isExtractOldValueForEditor.

Return whether to extract the old property value when applying a property editor to a new value for a property.

Annotations
@Override
setAutoGrowNestedPathsback to summary
public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths)

Implements org.springframework.beans.ConfigurablePropertyAccessor.setAutoGrowNestedPaths.

Doc from org.springframework.beans.ConfigurablePropertyAccessor.setAutoGrowNestedPaths.

Set whether this instance should attempt to "auto-grow" a nested path that contains a null value.

If true, a null path location will be populated with a default object value and traversed instead of resulting in a NullValueInNestedPathException.

Default is false on a plain PropertyAccessor instance.

Annotations
@Override
setExtractOldValueForEditorback to summary
public void setExtractOldValueForEditor(boolean extractOldValueForEditor)

Implements org.springframework.beans.ConfigurablePropertyAccessor.setExtractOldValueForEditor.

Doc from org.springframework.beans.ConfigurablePropertyAccessor.setExtractOldValueForEditor.

Set whether to extract the old property value when applying a property editor to a new value for a property.

Annotations
@Override
setPropertyValueback to summary
public void setPropertyValue(PropertyValue pv) throws BeansException

Implements org.springframework.beans.PropertyAccessor.setPropertyValue.

Doc from org.springframework.beans.PropertyAccessor.setPropertyValue.

Set the specified value as current property value.

Parameters
pv:PropertyValue

an object containing the new property value

Annotations
@Override
setPropertyValueback to summary
public abstract void setPropertyValue(String propertyName, Object value) throws BeansException

Redeclares org.springframework.beans.PropertyAccessor.setPropertyValue.

Actually set a property value.

Parameters
propertyName:String

name of the property to set value of

value:Object

the new value

Annotations
@Override
Exceptions
InvalidPropertyException:
if there is no such property or if the property isn't writable
PropertyAccessException:
if the property was valid but the accessor method failed or a type mismatch occurred
setPropertyValuesback to summary
public void setPropertyValues(Map<?, ?> map) throws BeansException

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

Doc from org.springframework.beans.PropertyAccessor.setPropertyValues.

Perform a batch update from a Map.

Bulk updates from PropertyValues are more powerful: This method is provided for convenience. Behavior will be identical to that of the setPropertyValues(PropertyValues) method.

Parameters
map:Map<?, ?>

a Map to take properties from. Contains property value objects, keyed by property name

Annotations
@Override
setPropertyValuesback to summary
public void setPropertyValues(PropertyValues pvs) throws BeansException

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

Doc from org.springframework.beans.PropertyAccessor.setPropertyValues.

The preferred way to perform a batch update.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Does not allow unknown fields or invalid fields.

Parameters
pvs:PropertyValues

a PropertyValues to set on the target object

Annotations
@Override
setPropertyValuesback to summary
public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown) throws BeansException

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

Doc from org.springframework.beans.PropertyAccessor.setPropertyValues.

Perform a batch update with more control over behavior.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Parameters
pvs:PropertyValues

a PropertyValues to set on the target object

ignoreUnknown:boolean

should we ignore unknown properties (not found in the bean)

Annotations
@Override
setPropertyValuesback to summary
public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid) throws BeansException

Implements org.springframework.beans.PropertyAccessor.setPropertyValues.

Doc from org.springframework.beans.PropertyAccessor.setPropertyValues.

Perform a batch update with full control over behavior.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Parameters
pvs:PropertyValues

a PropertyValues to set on the target object

ignoreUnknown:boolean

should we ignore unknown properties (not found in the bean)

ignoreInvalid:boolean

should we ignore invalid properties (found but not accessible)

Annotations
@Override