类 ConfigurableWebBindingInitializer
- java.lang.Object
- org.springframework.web.bind.support.ConfigurableWebBindingInitializer
- 所有已实现的接口:
WebBindingInitializer
public class ConfigurableWebBindingInitializer extends Object implements WebBindingInitializer
ConvenientWebBindingInitializerfor declarative configuration in a Spring application context. Allows for reusing pre-configured initializers with multiple controller/handlers.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
setDirectFieldAccess(boolean),setMessageCodesResolver(org.springframework.validation.MessageCodesResolver),setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor),setValidator(Validator),setConversionService(ConversionService),setPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar)
构造器概要
构造器 构造器 说明 ConfigurableWebBindingInitializer()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 BindingErrorProcessorgetBindingErrorProcessor()Return the strategy to use for processing binding errors.ConversionServicegetConversionService()Return the ConversionService which will apply to every DataBinder.MessageCodesResolvergetMessageCodesResolver()Return the strategy to use for resolving errors into message codes.PropertyEditorRegistrar[]getPropertyEditorRegistrars()Return the PropertyEditorRegistrars to be applied to every DataBinder.ValidatorgetValidator()Return the Validator to apply after each binding step, if any.voidinitBinder(WebDataBinder binder)Initialize the given DataBinder.booleanisAutoGrowNestedPaths()Return whether a binder should attempt to "auto-grow" a nested path that contains a null value.booleanisDirectFieldAccess()Return 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.voidsetBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)Set the strategy to use for processing binding errors, that is, required field errors andPropertyAccessExceptions.voidsetConversionService(ConversionService conversionService)Specify a ConversionService which will apply to every DataBinder.voidsetDirectFieldAccess(boolean directFieldAccess)Set whether to use direct field access instead of bean property access.voidsetMessageCodesResolver(MessageCodesResolver messageCodesResolver)Set the strategy to use for resolving errors into message codes.voidsetPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)Specify a single PropertyEditorRegistrar to be applied to every DataBinder.voidsetPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.voidsetValidator(Validator validator)Set the Validator to apply after each binding step.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.bind.support.WebBindingInitializer
initBinder
构造器详细资料
ConfigurableWebBindingInitializer
public ConfigurableWebBindingInitializer()
方法详细资料
setAutoGrowNestedPaths
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.
isAutoGrowNestedPaths
public boolean isAutoGrowNestedPaths()
Return whether a binder should attempt to "auto-grow" a nested path that contains a null value.
setDirectFieldAccess
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 totruein order to enforce direct field access.
isDirectFieldAccess
public boolean isDirectFieldAccess()
Return whether to use direct field access instead of bean property access.
setMessageCodesResolver
public final void setMessageCodesResolver(@Nullable 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.
getMessageCodesResolver
@Nullable public final MessageCodesResolver getMessageCodesResolver()
Return the strategy to use for resolving errors into message codes.
setBindingErrorProcessor
public final void setBindingErrorProcessor(@Nullable BindingErrorProcessor bindingErrorProcessor)
Set 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.
getBindingErrorProcessor
@Nullable public final BindingErrorProcessor getBindingErrorProcessor()
Return the strategy to use for processing binding errors.
setValidator
public final void setValidator(@Nullable Validator validator)
Set the Validator to apply after each binding step.
getValidator
@Nullable public final Validator getValidator()
Return the Validator to apply after each binding step, if any.
setConversionService
public final void setConversionService(@Nullable ConversionService conversionService)
Specify a ConversionService which will apply to every DataBinder.- 从以下版本开始:
- 3.0
getConversionService
@Nullable public final ConversionService getConversionService()
Return the ConversionService which will apply to every DataBinder.
setPropertyEditorRegistrar
public final void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)
Specify a single PropertyEditorRegistrar to be applied to every DataBinder.
setPropertyEditorRegistrars
public final void setPropertyEditorRegistrars(@Nullable PropertyEditorRegistrar[] propertyEditorRegistrars)
Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.
getPropertyEditorRegistrars
@Nullable public final PropertyEditorRegistrar[] getPropertyEditorRegistrars()
Return the PropertyEditorRegistrars to be applied to every DataBinder.
initBinder
public void initBinder(WebDataBinder binder)
从接口复制的说明:WebBindingInitializerInitialize the given DataBinder.- 指定者:
initBinder在接口中WebBindingInitializer- 参数:
binder- the DataBinder to initialize