org.silverpeas.servlet
Class RequestParameterDecoder

java.lang.Object
  extended by org.silverpeas.servlet.RequestParameterDecoder

public class RequestParameterDecoder
extends Object

This class decodes the request parameters in order to set them to a simple specified POJO which attributes are annotated by FormParam or XmlElement annotation.
It is possible to annotate the attribute with UnescapeHtml annotation in order to perform an HTML unescape operation (string type only).
WARNINGS:


Constructor Summary
RequestParameterDecoder()
           
 
Method Summary
static
<OBJECT> OBJECT
decode(HttpRequest request, Class<OBJECT> objectClass)
          Decodes the request parameters in order to return an object filled with their values.
static
<OBJECT> OBJECT
decode(javax.servlet.ServletRequest request, Class<OBJECT> objectClass)
          Decodes the request parameters in order to return an object filled with their values.
protected static RequestParameterDecoder getInstance()
          Gets the singleton instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestParameterDecoder

public RequestParameterDecoder()
Method Detail

getInstance

protected static RequestParameterDecoder getInstance()
Gets the singleton instance.

Returns:

decode

public static <OBJECT> OBJECT decode(javax.servlet.ServletRequest request,
                                     Class<OBJECT> objectClass)
Decodes the request parameters in order to return an object filled with their values.

Type Parameters:
OBJECT - the type of the requested returned instance.
Parameters:
request - the ServletRequest that will be wrapped by HttpRequest
objectClass - the class of the requested returned instance.
Returns:

decode

public static <OBJECT> OBJECT decode(HttpRequest request,
                                     Class<OBJECT> objectClass)
Decodes the request parameters in order to return an object filled with their values.

Type Parameters:
OBJECT - the type of the requested returned instance.
Parameters:
request - the HttpRequest wrapper that handle efficiently all parameters, included those of multipart request type.
objectClass - the class of the requested returned instance.
Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.