Package org.appng.api

Class RequestDataBinder<T>

  • Type Parameters:
    T - The type to bind the data to.
    All Implemented Interfaces:
    org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter
    Direct Known Subclasses:
    FormDataBinder

    public class RequestDataBinder<T>
    extends org.springframework.validation.DataBinder
    A DataBinder that uses a Request to bind its values to the target object.
    This class is especially useful inside a Webservice, as shown below:
    byte[] processRequest(Site site, Application application, Environment environment, Request request)
            throws BusinessException;
        RequestDataBinder requestDataBinder = new RequestDataBinder(new Person(), request);
        Person person = requestDataBinder.bind();
        // proceed with person
    }
     
    Also note the possibility to set a custom ConversionService for the binder.
    Author:
    Matthias Müller
    • Field Summary

      • Fields inherited from class org.springframework.validation.DataBinder

        DEFAULT_AUTO_GROW_COLLECTION_LIMIT, DEFAULT_OBJECT_NAME, logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addValue​(org.springframework.beans.MutablePropertyValues mpvs, String name, List<?> values)  
      T bind()
      Performs the actual binding.
      • Methods inherited from class org.springframework.validation.DataBinder

        addCustomFormatter, addCustomFormatter, addCustomFormatter, addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, convertIfNecessary, createBeanPropertyBindingResult, createDirectFieldBindingResult, doBind, 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, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate, validate
    • Constructor Detail

      • RequestDataBinder

        public RequestDataBinder​(T target,
                                 Request request)
        Constructs a new RequestDataBinder using a DefaultConversionService
        Parameters:
        target - the target object
        request - the Request
      • RequestDataBinder

        public RequestDataBinder​(T target,
                                 Request request,
                                 org.springframework.core.convert.ConversionService conversionService)
        Constructs a new RequestDataBinder using the given ConversionService
        Parameters:
        target - the target object
        request - the Request
        conversionService - the ConversionService to use
      • RequestDataBinder

        protected RequestDataBinder​(T target)