Interface ConfigurablePropertyAccessor
- All Superinterfaces:
PropertyAccessor, PropertyEditorRegistry, TypeConverter
- All Known Subinterfaces:
BeanWrapper
- All Known Implementing Classes:
AbstractNestablePropertyAccessor, AbstractPropertyAccessor, BeanWrapperImpl, DirectFieldAccessor
PropertyAccessor.
Also extends the PropertyEditorRegistry interface, which defines methods
for PropertyEditor management.
Serves as base interface for BeanWrapper.
- Since:
- 2.0
- Author:
- Juergen Hoeller, Stephane Nicoll, Sam Brannen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault maximum nesting depth permitted for a nested property path: 100.Fields inherited from interface PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR -
Method Summary
Modifier and TypeMethodDescriptionintReturn the limit for array and collection auto-growing.Return the associated ConversionService, if any.intReturn the maximum nesting depth permitted for a nested property path.booleanReturn whether "auto-growing" of nested paths has been activated.booleanReturn whether to extract the old property value when applying a property editor to a new value for a property.voidsetAutoGrowCollectionLimit(int autoGrowCollectionLimit) Specify a limit for array and collection auto-growing.voidsetAutoGrowNestedPaths(boolean autoGrowNestedPaths) Set whether this instance should attempt to "auto-grow" a nested path that contains anullvalue.voidsetConversionService(@Nullable ConversionService conversionService) Specify aConversionServiceto use for converting property values, as an alternative to JavaBeans PropertyEditors.voidsetExtractOldValueForEditor(boolean extractOldValueForEditor) Set whether to extract the old property value when applying a property editor to a new value for a property.voidsetMaxNestedPathDepth(int maxNestedPathDepth) Specify the maximum nesting depth permitted for a nested property path.Methods inherited from interface PropertyAccessor
getPropertyType, getPropertyTypeDescriptor, getPropertyValue, isReadableProperty, isWritableProperty, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValuesMethods inherited from interface PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditorMethods inherited from interface TypeConverter
convertIfNecessary, convertIfNecessary, convertIfNecessary, convertIfNecessary
-
Field Details
-
DEFAULT_MAX_NESTED_PATH_DEPTH
static final int DEFAULT_MAX_NESTED_PATH_DEPTHDefault maximum nesting depth permitted for a nested property path: 100.This limit guards against deeply nested property paths that could otherwise drive the recursive resolution of a nested property path to exhaust the current thread's call stack.
NOTE: This limit improves diagnostics for the common case by converting what would otherwise be an opaque
StackOverflowErrorinto a descriptiveInvalidPropertyException, but it is not a guaranteed defense againstStackOverflowErrorunder every possible JVM thread stack size configuration. The amount of stack space consumed per level of nesting depends on the JVM, its current JIT compilation state, and the platform.- Since:
- 7.1
- See Also:
-
-
Method Details
-
setConversionService
Specify aConversionServiceto use for converting property values, as an alternative to JavaBeans PropertyEditors. -
getConversionService
@Nullable ConversionService getConversionService()Return the associated ConversionService, if any. -
setExtractOldValueForEditor
void setExtractOldValueForEditor(boolean extractOldValueForEditor) Set whether to extract the old property value when applying a property editor to a new value for a property. -
isExtractOldValueForEditor
boolean isExtractOldValueForEditor()Return whether to extract the old property value when applying a property editor to a new value for a property. -
setAutoGrowNestedPaths
void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) Set whether this instance should attempt to "auto-grow" a nested path that contains anullvalue.If
true, anullpath location will be populated with a default object value and traversed instead of resulting in aNullValueInNestedPathException.Default is
falseon a plain accessor.- Since:
- 4.1
-
isAutoGrowNestedPaths
boolean isAutoGrowNestedPaths()Return whether "auto-growing" of nested paths has been activated.- Since:
- 4.1
-
setAutoGrowCollectionLimit
void setAutoGrowCollectionLimit(int autoGrowCollectionLimit) Specify a limit for array and collection auto-growing.Default is unlimited on a plain accessor.
- Since:
- 7.1
-
getAutoGrowCollectionLimit
int getAutoGrowCollectionLimit()Return the limit for array and collection auto-growing.- Since:
- 7.1
-
setMaxNestedPathDepth
void setMaxNestedPathDepth(int maxNestedPathDepth) Specify the maximum nesting depth permitted for a nested property path.The nesting depth corresponds to the number of intermediate properties traversed to reach the final property — for example,
"address.country.name"has a nesting depth of 2.Specify
0to disable nested property paths altogether, while still allowing simple, indexed, and mapped property access.Default is
DEFAULT_MAX_NESTED_PATH_DEPTH.- Parameters:
maxNestedPathDepth- the maximum nesting depth; must not be negative- Since:
- 7.1
-
getMaxNestedPathDepth
int getMaxNestedPathDepth()Return the maximum nesting depth permitted for a nested property path.- Since:
- 7.1
-