spring-framework / org.springframework.web.bind.support / ConfigurableWebBindingInitializer

ConfigurableWebBindingInitializer

open class ConfigurableWebBindingInitializer : WebBindingInitializer

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

Constructors

<init>

ConfigurableWebBindingInitializer()

Convenient WebBindingInitializer for declarative configuration in a Spring application context. Allows for reusing pre-configured initializers with multiple controller/handlers.

Functions

getBindingErrorProcessor

fun getBindingErrorProcessor(): BindingErrorProcessor

Return the strategy to use for processing binding errors.

getConversionService

fun getConversionService(): ConversionService

Return the ConversionService which will apply to every DataBinder.

getMessageCodesResolver

fun getMessageCodesResolver(): MessageCodesResolver

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

getPropertyEditorRegistrars

fun getPropertyEditorRegistrars(): Array<PropertyEditorRegistrar>

Return the PropertyEditorRegistrars to be applied to every DataBinder.

getValidator

fun getValidator(): Validator

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

initBinder

open fun initBinder(binder: WebDataBinder): Unit

isAutoGrowNestedPaths

open fun isAutoGrowNestedPaths(): Boolean

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

isDirectFieldAccess

open fun isDirectFieldAccess(): Boolean

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

setAutoGrowNestedPaths

open fun setAutoGrowNestedPaths(autoGrowNestedPaths: Boolean): Unit

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.

setBindingErrorProcessor

fun setBindingErrorProcessor(bindingErrorProcessor: BindingErrorProcessor): Unit

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.

setConversionService

fun setConversionService(conversionService: ConversionService): Unit

Specify a ConversionService which will apply to every DataBinder.

setDirectFieldAccess

fun setDirectFieldAccess(directFieldAccess: Boolean): Unit

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.

setMessageCodesResolver

fun setMessageCodesResolver(messageCodesResolver: MessageCodesResolver): Unit

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.

setPropertyEditorRegistrar

fun setPropertyEditorRegistrar(propertyEditorRegistrar: PropertyEditorRegistrar): Unit

Specify a single PropertyEditorRegistrar to be applied to every DataBinder.

setPropertyEditorRegistrars

fun setPropertyEditorRegistrars(propertyEditorRegistrars: Array<PropertyEditorRegistrar>): Unit

Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.

setValidator

fun setValidator(validator: Validator): Unit

Set the Validator to apply after each binding step.