org.springframework.boot.bind
Class RelaxedDataBinder

java.lang.Object
  extended by org.springframework.validation.DataBinder
      extended by org.springframework.boot.bind.RelaxedDataBinder
All Implemented Interfaces:
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).

Author:
Dave Syer
See Also:
RelaxedNames

Field Summary
 
Fields inherited from class org.springframework.validation.DataBinder
DEFAULT_AUTO_GROW_COLLECTION_LIMIT, DEFAULT_OBJECT_NAME, logger
 
Constructor Summary
RelaxedDataBinder(Object target)
           
RelaxedDataBinder(Object target, String namePrefix)
           
 
Method Summary
protected  void doBind(org.springframework.beans.MutablePropertyValues propertyValues)
           
protected  String normalizePath(org.springframework.beans.BeanWrapper wrapper, String path)
          Normalize a bean property path to a format understood by a BeanWrapper.
 
Methods inherited from class org.springframework.validation.DataBinder
addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelaxedDataBinder

public RelaxedDataBinder(Object target)
Parameters:
target - the target into which properties are bound

RelaxedDataBinder

public RelaxedDataBinder(Object target,
                         String namePrefix)
Parameters:
target - the target into which properties are bound
namePrefix - An optional prefix to be used when reading properties
Method Detail

doBind

protected void doBind(org.springframework.beans.MutablePropertyValues propertyValues)
Overrides:
doBind in class 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

Parameters:
wrapper - a bean wrapper for the object to bind
path - the bean path to bind
Returns:
a transformed path with correct bean wrapper syntax


Copyright © 2013. All Rights Reserved.