类 ConfigurableWebBindingInitializer

java.lang.Object
cn.taketoday.web.bind.support.ConfigurableWebBindingInitializer
所有已实现的接口:
WebBindingInitializer

public class ConfigurableWebBindingInitializer extends Object implements 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
另请参阅:
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private boolean
     
    private cn.taketoday.validation.BindingErrorProcessor
     
    private cn.taketoday.core.conversion.ConversionService
     
    private Boolean
     
    private boolean
     
    private cn.taketoday.validation.MessageCodesResolver
     
    private cn.taketoday.beans.PropertyEditorRegistrar[]
     
    private cn.taketoday.validation.Validator
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    final cn.taketoday.validation.BindingErrorProcessor
    Return the strategy to use for processing binding errors.
    final cn.taketoday.core.conversion.ConversionService
    Return the ConversionService which will apply to every DataBinder.
    final cn.taketoday.validation.MessageCodesResolver
    Return 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<?>
     
    final cn.taketoday.validation.Validator
    Return the Validator to apply after each binding step, if any.
    void
    Initialize the given DataBinder.
    boolean
    Return whether a binder should attempt to "auto-grow" a nested path that contains a null value.
    boolean
    Return whether to bind only fields intended for binding.
    boolean
    Return whether to use direct field access instead of bean property access.
    void
    setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
    Set whether a binder should attempt to "auto-grow" a nested path that contains a null value.
    final void
    setBindingErrorProcessor(cn.taketoday.validation.BindingErrorProcessor bindingErrorProcessor)
    Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
    final void
    setConversionService(cn.taketoday.core.conversion.ConversionService conversionService)
    Specify a ConversionService which will apply to every DataBinder.
    void
    setDeclarativeBinding(boolean declarativeBinding)
    Set whether to bind only fields intended for binding as described in DataBinder.setDeclarativeBinding(boolean).
    final void
    setDirectFieldAccess(boolean directFieldAccess)
    Set whether to use direct field access instead of bean property access.
    final void
    setMessageCodesResolver(cn.taketoday.validation.MessageCodesResolver messageCodesResolver)
    Set the strategy to use for resolving errors into message codes.
    final void
    setPropertyEditorRegistrar(cn.taketoday.beans.PropertyEditorRegistrar propertyEditorRegistrar)
    Specify a single PropertyEditorRegistrar to be applied to every DataBinder.
    final void
    setPropertyEditorRegistrars(cn.taketoday.beans.PropertyEditorRegistrar[] propertyEditorRegistrars)
    Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.
    final void
    setValidator(cn.taketoday.validation.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
  • 字段详细资料

    • autoGrowNestedPaths

      private boolean autoGrowNestedPaths
    • directFieldAccess

      private boolean directFieldAccess
    • declarativeBinding

      @Nullable private Boolean 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 to true in 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 in DataBinder.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 and PropertyAccessExceptions.

      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

      public void initBinder(WebDataBinder binder)
      从接口复制的说明: WebBindingInitializer
      Initialize the given DataBinder.
      指定者:
      initBinder 在接口中 WebBindingInitializer
      参数:
      binder - the DataBinder to initialize
    • getTargetType

      @Nullable private static Class<?> getTargetType(WebDataBinder binder)