Class ConfigurableWebBindingInitializer
java.lang.Object
org.springframework.web.bind.support.ConfigurableWebBindingInitializer
- All Implemented Interfaces:
- WebBindingInitializer
Convenient 
WebBindingInitializer for declarative configuration
 in a Spring application context. Allows for reusing pre-configured
 initializers with multiple controller/handlers.- Since:
- 2.5
- Author:
- Juergen Hoeller
- See Also:
- 
- setDirectFieldAccess(boolean)
- setMessageCodesResolver(org.springframework.validation.MessageCodesResolver)
- setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor)
- setValidator(Validator)
- setConversionService(ConversionService)
- setPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar)
 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal BindingErrorProcessorReturn the strategy to use for processing binding errors.final ConversionServiceReturn the ConversionService which will apply to every DataBinder.final MessageCodesResolverReturn the strategy to use for resolving errors into message codes.final PropertyEditorRegistrar[]Return the PropertyEditorRegistrars to be applied to every DataBinder.final ValidatorReturn the Validator to apply after each binding step, if any.voidinitBinder(WebDataBinder binder) Initialize the given DataBinder.booleanReturn whether a binder should attempt to "auto-grow" a nested path that contains a null value.booleanReturn whether to bind only fields intended for binding.booleanReturn whether to use direct field access instead of bean property access.voidsetAutoGrowNestedPaths(boolean autoGrowNestedPaths) Set whether a binder should attempt to "auto-grow" a nested path that contains a null value.final voidsetBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor) Set the strategy to use for processing binding errors, that is, required field errors andPropertyAccessExceptions.final voidsetConversionService(ConversionService conversionService) Specify a ConversionService which will apply to every DataBinder.voidsetDeclarativeBinding(boolean declarativeBinding) Set whether to bind only fields intended for binding as described inDataBinder.setDeclarativeBinding(boolean).final voidsetDirectFieldAccess(boolean directFieldAccess) Set whether to use direct field access instead of bean property access.final voidsetMessageCodesResolver(MessageCodesResolver messageCodesResolver) Set the strategy to use for resolving errors into message codes.final voidsetPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar) Specify a single PropertyEditorRegistrar to be applied to every DataBinder.final voidsetPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars) Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.final voidsetValidator(Validator validator) Set the Validator to apply after each binding step.
- 
Constructor Details- 
ConfigurableWebBindingInitializerpublic ConfigurableWebBindingInitializer()
 
- 
- 
Method Details- 
setAutoGrowNestedPathspublic 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. 
- 
isAutoGrowNestedPathspublic boolean isAutoGrowNestedPaths()Return whether a binder should attempt to "auto-grow" a nested path that contains a null value.
- 
setDirectFieldAccesspublic 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 totruein order to enforce direct field access.
- 
isDirectFieldAccesspublic boolean isDirectFieldAccess()Return whether to use direct field access instead of bean property access.
- 
setDeclarativeBindingpublic void setDeclarativeBinding(boolean declarativeBinding) Set whether to bind only fields intended for binding as described inDataBinder.setDeclarativeBinding(boolean).- Since:
- 6.1
 
- 
isDeclarativeBindingpublic boolean isDeclarativeBinding()Return whether to bind only fields intended for binding.- Since:
- 6.1
 
- 
setMessageCodesResolverSet 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.
- 
getMessageCodesResolverReturn the strategy to use for resolving errors into message codes.
- 
setBindingErrorProcessorSet the strategy to use for processing binding errors, that is, required field errors andPropertyAccessExceptions.Default is null, that is, using the default strategy of the data binder.
- 
getBindingErrorProcessorReturn the strategy to use for processing binding errors.
- 
setValidatorSet the Validator to apply after each binding step.
- 
getValidatorReturn the Validator to apply after each binding step, if any.
- 
setConversionServiceSpecify a ConversionService which will apply to every DataBinder.- Since:
- 3.0
 
- 
getConversionServiceReturn the ConversionService which will apply to every DataBinder.
- 
setPropertyEditorRegistrarSpecify a single PropertyEditorRegistrar to be applied to every DataBinder.
- 
setPropertyEditorRegistrarspublic final void setPropertyEditorRegistrars(@Nullable PropertyEditorRegistrar[] propertyEditorRegistrars) Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.
- 
getPropertyEditorRegistrarsReturn the PropertyEditorRegistrars to be applied to every DataBinder.
- 
initBinderDescription copied from interface:WebBindingInitializerInitialize the given DataBinder.- Specified by:
- initBinderin interface- WebBindingInitializer
- Parameters:
- binder- the DataBinder to initialize
 
 
-