Interface ConfigurablePropertyAccessor

All Superinterfaces:
PropertyAccessor, PropertyEditorRegistry, TypeConverter
All Known Subinterfaces:
BeanWrapper
All Known Implementing Classes:
AbstractNestablePropertyAccessor, AbstractPropertyAccessor, BeanWrapperImpl, DirectFieldAccessor

public interface ConfigurablePropertyAccessor extends PropertyAccessor, PropertyEditorRegistry, TypeConverter
Interface that encapsulates configuration methods for a 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 Details

    • DEFAULT_MAX_NESTED_PATH_DEPTH

      static final int DEFAULT_MAX_NESTED_PATH_DEPTH
      Default 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 StackOverflowError into a descriptive InvalidPropertyException, but it is not a guaranteed defense against StackOverflowError under 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

      void setConversionService(@Nullable ConversionService conversionService)
      Specify a ConversionService to 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 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 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 0 to 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