org.appng.api

## Class RequestDataBinder<T>

- java.lang.Object
- - org.springframework.validation.DataBinder
  - - org.appng.api.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`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `RequestDataBinder(T target)`
    `` | `RequestDataBinder(T target, Request request)` Constructs a new `RequestDataBinder` using a `DefaultConversionService`
    `` | `RequestDataBinder(T target, Request request, org.springframework.core.convert.ConversionService conversionService)` Constructs a new `RequestDataBinder` using the given `ConversionService`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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, 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, 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

    - #### 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)

  - ### Method Detail

    - #### bind

          public T bind()

      Performs the actual binding. Therefore `RequestContainer.getParameterNames()` and `RequestContainer.getFormUploads()` is used.
      Returns:
        the object where the binding has been applied to

    - #### addValue

          protected void addValue(org.springframework.beans.MutablePropertyValues mpvs,
                                  String name,
                                  List<?> values)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.