com.acsinet_solutions.cetia4.controller.rest
Class DTOParamBinder

java.lang.Object
  extended by com.acsinet_solutions.cetia4.controller.rest.DTOParamBinder
All Implemented Interfaces:
ParamBinder

public class DTOParamBinder
extends java.lang.Object
implements ParamBinder

Parameter binder for DTOs, or JavaBeans with getter and setters methods.

Author:
Santiago Arriaga

Constructor Summary
DTOParamBinder(java.lang.Class paramType, java.lang.reflect.Method method)
          Create a parameter binder for the given type, using a default bean request mapper.
DTOParamBinder(RequestMapper mapper, java.lang.Class paramType, java.lang.reflect.Method method)
          Create a parameter binder for the given type, specifying the request mapper.
 
Method Summary
 java.lang.Object bind(RequestContext context)
          Bind the current request using the given request context instance.
 RequestMapper getRequestMapper()
          Get the request mapper for this binder, available here for external customization.
 void setRequestMapper(RequestMapper mapper)
          Allows an implementation to change completely the request mapper of a parameter binder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTOParamBinder

public DTOParamBinder(java.lang.Class paramType,
                      java.lang.reflect.Method method)
Create a parameter binder for the given type, using a default bean request mapper.

Parameters:
key - The key of the HTTP parameter that feeds this binder

DTOParamBinder

public DTOParamBinder(RequestMapper mapper,
                      java.lang.Class paramType,
                      java.lang.reflect.Method method)
Create a parameter binder for the given type, specifying the request mapper.

Parameters:
key - The key of the HTTP parameter that feeds this binder
Method Detail

getRequestMapper

public final RequestMapper getRequestMapper()
Description copied from interface: ParamBinder
Get the request mapper for this binder, available here for external customization.

Specified by:
getRequestMapper in interface ParamBinder

setRequestMapper

public void setRequestMapper(RequestMapper mapper)
Description copied from interface: ParamBinder
Allows an implementation to change completely the request mapper of a parameter binder.

Specified by:
setRequestMapper in interface ParamBinder

bind

public final java.lang.Object bind(RequestContext context)
                            throws ValidationException
Description copied from interface: ParamBinder
Bind the current request using the given request context instance. This process implies assigning a value to the parameter in a render or action method associated with the current param binder.

Specified by:
bind in interface ParamBinder
Throws:
ValidationException