Top Description Fields Constructors Methods
org.springframework.web.bind.support

public Class ConfigurableWebBindingInitializer

extends Object
implements WebBindingInitializer
Class Inheritance
All Implemented Interfaces
org.springframework.web.bind.support.WebBindingInitializer
Imports
org.springframework.beans.PropertyEditorRegistrar, org.springframework.core.convert.ConversionService, org.springframework.lang.Nullable, org.springframework.validation.BindingErrorProcessor, .MessageCodesResolver, .Validator, org.springframework.web.bind.WebDataBinder

Convenient WebBindingInitializer for declarative configuration in a Spring application context. Allows for reusing pre-configured initializers with multiple controller/handlers.
Author
Juergen Hoeller
Since
2.5
See Also
setDirectFieldAccess, setMessageCodesResolver, setBindingErrorProcessor, setValidator(Validator), setConversionService(ConversionService), setPropertyEditorRegistrar

Field Summary

Modifier and TypeField and Description
private boolean
private BindingErrorProcessor
private ConversionService
private Boolean
private boolean
private MessageCodesResolver
private PropertyEditorRegistrar[]
private Validator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final BindingErrorProcessor
getBindingErrorProcessor()

Return the strategy to use for processing binding errors.

public final ConversionService
getConversionService()

Return the ConversionService which will apply to every DataBinder.

public final MessageCodesResolver
getMessageCodesResolver()

Return the strategy to use for resolving errors into message codes.

public final PropertyEditorRegistrar[]
getPropertyEditorRegistrars()

Return the PropertyEditorRegistrars to be applied to every DataBinder.

private static Class<?>
public final Validator
getValidator()

Return the Validator to apply after each binding step, if any.

public void
initBinder(WebDataBinder
the DataBinder to initialize
binder
)

Implements org.springframework.web.bind.support.WebBindingInitializer.initBinder.

Initialize the given DataBinder.
public boolean
isAutoGrowNestedPaths()

Return whether a binder should attempt to "auto-grow" a nested path that contains a null value.

public boolean
isDeclarativeBinding()

Return whether to bind only fields intended for binding.

public boolean
isDirectFieldAccess()

Return whether to use direct field access instead of bean property access.

public void
setAutoGrowNestedPaths(boolean autoGrowNestedPaths)

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

public final void
setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)

Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.

public final void
setConversionService(ConversionService conversionService)

Specify a ConversionService which will apply to every DataBinder.

public void
setDeclarativeBinding(boolean declarativeBinding)

Set whether to bind only fields intended for binding as described in org.springframework.validation.DataBinder#setDeclarativeBinding.

public final void
setDirectFieldAccess(boolean directFieldAccess)

Set whether to use direct field access instead of bean property access.

public final void
setMessageCodesResolver(MessageCodesResolver messageCodesResolver)

Set the strategy to use for resolving errors into message codes.

public final void
setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)

Specify a single PropertyEditorRegistrar to be applied to every DataBinder.

public final void
setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)

Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.

public final void
setValidator(Validator validator)

Set the Validator to apply after each binding step.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoGrowNestedPathsback to summary
private boolean autoGrowNestedPaths
bindingErrorProcessorback to summary
private BindingErrorProcessor bindingErrorProcessor
Annotations
@Nullable
conversionServiceback to summary
private ConversionService conversionService
Annotations
@Nullable
declarativeBindingback to summary
private Boolean declarativeBinding
Annotations
@Nullable
directFieldAccessback to summary
private boolean directFieldAccess
messageCodesResolverback to summary
private MessageCodesResolver messageCodesResolver
Annotations
@Nullable
propertyEditorRegistrarsback to summary
private PropertyEditorRegistrar[] propertyEditorRegistrars
Annotations
@Nullable
validatorback to summary
private Validator validator
Annotations
@Nullable

Constructor Detail

ConfigurableWebBindingInitializerback to summary
public ConfigurableWebBindingInitializer()

Method Detail

getBindingErrorProcessorback to summary
public final BindingErrorProcessor getBindingErrorProcessor()

Return the strategy to use for processing binding errors.

Annotations
@Nullable
getConversionServiceback to summary
public final ConversionService getConversionService()

Return the ConversionService which will apply to every DataBinder.

Annotations
@Nullable
getMessageCodesResolverback to summary
public final MessageCodesResolver getMessageCodesResolver()

Return the strategy to use for resolving errors into message codes.

Annotations
@Nullable
getPropertyEditorRegistrarsback to summary
public final PropertyEditorRegistrar[] getPropertyEditorRegistrars()

Return the PropertyEditorRegistrars to be applied to every DataBinder.

Annotations
@Nullable
getTargetTypeback to summary
private static Class<?> getTargetType(WebDataBinder binder)
Annotations
@Nullable
getValidatorback to summary
public final Validator getValidator()

Return the Validator to apply after each binding step, if any.

Annotations
@Nullable
initBinderback to summary
public void initBinder(WebDataBinder binder)

Implements org.springframework.web.bind.support.WebBindingInitializer.initBinder.

Doc from org.springframework.web.bind.support.WebBindingInitializer.initBinder.

Initialize the given DataBinder.

Parameters
binder:WebDataBinder

the DataBinder to initialize

Annotations
@Override
isAutoGrowNestedPathsback to summary
public boolean isAutoGrowNestedPaths()

Return whether a binder should attempt to "auto-grow" a nested path that contains a null value.

isDeclarativeBindingback to summary
public boolean isDeclarativeBinding()

Return whether to bind only fields intended for binding.

Since
6.1
isDirectFieldAccessback to summary
public boolean isDirectFieldAccess()

Return whether to use direct field access instead of bean property access.

setAutoGrowNestedPathsback to summary
public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths)

Set whether a binder 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 an exception. This flag also enables auto-growth of collection elements when accessing an out-of-bounds index.

Default is "true" on a standard DataBinder. Note that this feature is only supported for bean property access (DataBinder's default mode), not for field access.

See Also
org.springframework.validation.DataBinder#initBeanPropertyAccess(), org.springframework.validation.DataBinder#setAutoGrowNestedPaths
setBindingErrorProcessorback to summary
public final void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)

Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.

Default is null, that is, using the default strategy of the data binder.

See Also
org.springframework.validation.DataBinder#setBindingErrorProcessor
setConversionServiceback to summary
public final void setConversionService(ConversionService conversionService)

Specify a ConversionService which will apply to every DataBinder.

Since
3.0
setDeclarativeBindingback to summary
public void setDeclarativeBinding(boolean declarativeBinding)

Set whether to bind only fields intended for binding as described in org.springframework.validation.DataBinder#setDeclarativeBinding.

Since
6.1
setDirectFieldAccessback to summary
public final void setDirectFieldAccess(boolean directFieldAccess)

Set whether to use direct field access instead of bean property access.

Default is false, using bean property access. Switch this to true in order to enforce direct field access.

See Also
org.springframework.validation.DataBinder#initDirectFieldAccess(), org.springframework.validation.DataBinder#initBeanPropertyAccess()
setMessageCodesResolverback to summary
public final void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)

Set the strategy to use for resolving errors into message codes. Applies the given strategy to all data binders used by this controller.

Default is null, i.e. using the default strategy of the data binder.

See Also
org.springframework.validation.DataBinder#setMessageCodesResolver
setPropertyEditorRegistrarback to summary
public final void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)

Specify a single PropertyEditorRegistrar to be applied to every DataBinder.

setPropertyEditorRegistrarsback to summary
public final void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)

Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.

setValidatorback to summary
public final void setValidator(Validator validator)

Set the Validator to apply after each binding step.