类 ConfigurableWebBindingInitializer
java.lang.Object
cn.taketoday.web.bind.support.ConfigurableWebBindingInitializer
- 所有已实现的接口:
WebBindingInitializer
Convenient
WebBindingInitializer for declarative configuration
in a Infra application context. Allows for reusing pre-configured
initializers with multiple controller/handlers.- 从以下版本开始:
- 4.0 2022/4/8 22:52
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
setDirectFieldAccess(boolean)setMessageCodesResolver(cn.taketoday.validation.MessageCodesResolver)setBindingErrorProcessor(cn.taketoday.validation.BindingErrorProcessor)setValidator(Validator)setConversionService(ConversionService)setPropertyEditorRegistrar(cn.taketoday.beans.PropertyEditorRegistrar)
-
字段概要
字段修饰符和类型字段说明private booleanprivate cn.taketoday.validation.BindingErrorProcessorprivate cn.taketoday.core.conversion.ConversionServiceprivate Booleanprivate booleanprivate cn.taketoday.validation.MessageCodesResolverprivate cn.taketoday.beans.PropertyEditorRegistrar[]private cn.taketoday.validation.Validator -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final cn.taketoday.validation.BindingErrorProcessorReturn the strategy to use for processing binding errors.final cn.taketoday.core.conversion.ConversionServiceReturn the ConversionService which will apply to every DataBinder.final cn.taketoday.validation.MessageCodesResolverReturn the strategy to use for resolving errors into message codes.final cn.taketoday.beans.PropertyEditorRegistrar[]Return the PropertyEditorRegistrars to be applied to every DataBinder.private static Class<?>getTargetType(WebDataBinder binder) final cn.taketoday.validation.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(cn.taketoday.validation.BindingErrorProcessor bindingErrorProcessor) Set the strategy to use for processing binding errors, that is, required field errors andPropertyAccessExceptions.final voidsetConversionService(cn.taketoday.core.conversion.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(cn.taketoday.validation.MessageCodesResolver messageCodesResolver) Set the strategy to use for resolving errors into message codes.final voidsetPropertyEditorRegistrar(cn.taketoday.beans.PropertyEditorRegistrar propertyEditorRegistrar) Specify a single PropertyEditorRegistrar to be applied to every DataBinder.final voidsetPropertyEditorRegistrars(cn.taketoday.beans.PropertyEditorRegistrar[] propertyEditorRegistrars) Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.final voidsetValidator(cn.taketoday.validation.Validator validator) Set the Validator to apply after each binding step.
-
字段详细资料
-
autoGrowNestedPaths
private boolean autoGrowNestedPaths -
directFieldAccess
private boolean directFieldAccess -
declarativeBinding
-
messageCodesResolver
@Nullable private cn.taketoday.validation.MessageCodesResolver messageCodesResolver -
bindingErrorProcessor
@Nullable private cn.taketoday.validation.BindingErrorProcessor bindingErrorProcessor -
validator
@Nullable private cn.taketoday.validation.Validator validator -
conversionService
@Nullable private cn.taketoday.core.conversion.ConversionService conversionService -
propertyEditorRegistrars
@Nullable private cn.taketoday.beans.PropertyEditorRegistrar[] propertyEditorRegistrars
-
-
构造器详细资料
-
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.
- 另请参阅:
-
DataBinder.initBeanPropertyAccess()DataBinder.setAutoGrowNestedPaths(boolean)
-
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.- 另请参阅:
-
DataBinder.initDirectFieldAccess()DataBinder.initBeanPropertyAccess()
-
isDirectFieldAccess
public boolean isDirectFieldAccess()Return whether to use direct field access instead of bean property access. -
setDeclarativeBinding
public void setDeclarativeBinding(boolean declarativeBinding) Set whether to bind only fields intended for binding as described inDataBinder.setDeclarativeBinding(boolean). -
isDeclarativeBinding
public boolean isDeclarativeBinding()Return whether to bind only fields intended for binding. -
setMessageCodesResolver
public final void setMessageCodesResolver(@Nullable cn.taketoday.validation.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.- 另请参阅:
-
DataBinder.setMessageCodesResolver(cn.taketoday.validation.MessageCodesResolver)
-
getMessageCodesResolver
@Nullable public final cn.taketoday.validation.MessageCodesResolver getMessageCodesResolver()Return the strategy to use for resolving errors into message codes. -
setBindingErrorProcessor
public final void setBindingErrorProcessor(@Nullable cn.taketoday.validation.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.- 另请参阅:
-
DataBinder.setBindingErrorProcessor(cn.taketoday.validation.BindingErrorProcessor)
-
getBindingErrorProcessor
@Nullable public final cn.taketoday.validation.BindingErrorProcessor getBindingErrorProcessor()Return the strategy to use for processing binding errors. -
setValidator
public final void setValidator(@Nullable cn.taketoday.validation.Validator validator) Set the Validator to apply after each binding step. -
getValidator
@Nullable public final cn.taketoday.validation.Validator getValidator()Return the Validator to apply after each binding step, if any. -
setConversionService
public final void setConversionService(@Nullable cn.taketoday.core.conversion.ConversionService conversionService) Specify a ConversionService which will apply to every DataBinder. -
getConversionService
@Nullable public final cn.taketoday.core.conversion.ConversionService getConversionService()Return the ConversionService which will apply to every DataBinder. -
setPropertyEditorRegistrar
public final void setPropertyEditorRegistrar(cn.taketoday.beans.PropertyEditorRegistrar propertyEditorRegistrar) Specify a single PropertyEditorRegistrar to be applied to every DataBinder. -
setPropertyEditorRegistrars
public final void setPropertyEditorRegistrars(@Nullable cn.taketoday.beans.PropertyEditorRegistrar[] propertyEditorRegistrars) Specify multiple PropertyEditorRegistrars to be applied to every DataBinder. -
getPropertyEditorRegistrars
@Nullable public final cn.taketoday.beans.PropertyEditorRegistrar[] getPropertyEditorRegistrars()Return the PropertyEditorRegistrars to be applied to every DataBinder. -
initBinder
从接口复制的说明:WebBindingInitializerInitialize the given DataBinder.- 指定者:
initBinder在接口中WebBindingInitializer- 参数:
binder- the DataBinder to initialize
-
getTargetType
-