类 RelaxedDataBinder

  • 所有已实现的接口:
    org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter

    public class RelaxedDataBinder
    extends org.springframework.validation.DataBinder
    Binder implementation that allows caller to bind to maps and also allows property names to match a bit loosely (if underscores or dashes are removed and replaced with camel case for example).
    另请参阅:
    RelaxedNames
    • 字段概要

      • 从类继承的字段 org.springframework.validation.DataBinder

        DEFAULT_AUTO_GROW_COLLECTION_LIMIT, DEFAULT_OBJECT_NAME, logger
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      protected org.springframework.validation.AbstractPropertyBindingResultcreateBeanPropertyBindingResult() 
      protected voiddoBind​(org.springframework.beans.MutablePropertyValues propertyValues) 
      protected StringnormalizePath​(org.springframework.beans.BeanWrapper wrapper, String path)
      Normalize a bean property path to a format understood by a BeanWrapper.
      voidsetIgnoreNestedProperties​(boolean ignoreNestedProperties)
      Flag to disable binding of nested properties (i.e. those with period separators in their paths).
      voidsetNameAliases​(Map<String,​List<String>> aliases)
      Set name aliases.
      RelaxedDataBinderwithAlias​(String name, String... alias)
      Add aliases to the DataBinder.
      • 从类继承的方法 org.springframework.validation.DataBinder

        addCustomFormatter, addCustomFormatter, addCustomFormatter, addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, createDirectFieldBindingResult, findCustomEditor, getAllowedFields, getAutoGrowCollectionLimit, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getInternalBindingResult, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, getValidators, initBeanPropertyAccess, initDirectFieldAccess, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, replaceValidators, setAllowedFields, setAutoGrowCollectionLimit, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setExtractOldValueForEditor, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate, validate
    • 方法详细资料

      • setIgnoreNestedProperties

        public void setIgnoreNestedProperties​(boolean ignoreNestedProperties)
        Flag to disable binding of nested properties (i.e. those with period separators in their paths). Can be useful to disable this if the name prefix is empty and you don't want to ignore unknown fields.
        参数:
        ignoreNestedProperties - the flag to set (default false)
      • withAlias

        public RelaxedDataBinder withAlias​(String name,
                                           String... alias)
        Add aliases to the DataBinder.
        参数:
        name - the property name to alias
        alias - aliases for the property names
        返回:
        this instance
      • doBind

        protected void doBind​(org.springframework.beans.MutablePropertyValues propertyValues)
        覆盖:
        doBind 在类中 org.springframework.validation.DataBinder
      • normalizePath

        protected String normalizePath​(org.springframework.beans.BeanWrapper wrapper,
                                       String path)
        Normalize a bean property path to a format understood by a BeanWrapper. This is used so that
        • Fuzzy matching can be employed for bean property names
        • Period separators can be used instead of indexing ([...]) for map keys
        参数:
        wrapper - a bean wrapper for the object to bind
        path - the bean path to bind
        返回:
        a transformed path with correct bean wrapper syntax
      • createBeanPropertyBindingResult

        protected org.springframework.validation.AbstractPropertyBindingResult createBeanPropertyBindingResult()
        覆盖:
        createBeanPropertyBindingResult 在类中 org.springframework.validation.DataBinder