Class AbstractNestablePropertyAccessor

All Implemented Interfaces:
ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter
Direct Known Subclasses:
BeanWrapperImpl, DirectFieldAccessor

public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyAccessor
A basic ConfigurablePropertyAccessor that provides the necessary infrastructure for all typical use cases.

This accessor will convert collection and array values to the corresponding target collections or arrays, if necessary. Custom property editors that deal with collections or arrays can either be written via PropertyEditor's setValue, or against a comma-delimited String via setAsText, as String arrays are converted in such a format if the array itself is not assignable.

Since:
4.2
Author:
Juergen Hoeller, Stephane Nicoll, Rod Johnson, Rob Harrop, Sam Brannen
See Also:
  • Constructor Details

    • AbstractNestablePropertyAccessor

      protected AbstractNestablePropertyAccessor()
      Create a new empty accessor. Wrapped instance needs to be set afterwards. Registers default editors.
      See Also:
    • AbstractNestablePropertyAccessor

      protected AbstractNestablePropertyAccessor(boolean registerDefaultEditors)
      Create a new empty accessor. Wrapped instance needs to be set afterwards.
      Parameters:
      registerDefaultEditors - whether to register default editors (can be suppressed if the accessor won't need any type conversion)
      See Also:
    • AbstractNestablePropertyAccessor

      protected AbstractNestablePropertyAccessor(Object object)
      Create a new accessor for the given object.
      Parameters:
      object - the object wrapped by this accessor
    • AbstractNestablePropertyAccessor

      protected AbstractNestablePropertyAccessor(Class<?> clazz)
      Create a new accessor, wrapping a new instance of the specified class.
      Parameters:
      clazz - class to instantiate and wrap
    • AbstractNestablePropertyAccessor

      protected AbstractNestablePropertyAccessor(Object object, String nestedPath, Object rootObject)
      Create a new accessor for the given object, registering a nested path that the object is in.
      Parameters:
      object - the object wrapped by this accessor
      nestedPath - the nested path of the object
      rootObject - the root object at the top of the path
    • AbstractNestablePropertyAccessor

      protected AbstractNestablePropertyAccessor(Object object, String nestedPath, AbstractNestablePropertyAccessor parent)
      Create a new accessor for the given object, registering a nested path that the object is in.
      Parameters:
      object - the object wrapped by this accessor
      nestedPath - the nested path of the object
      parent - the containing accessor (must not be null)
  • Method Details