public class JsonRequest extends ActionRequest
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_CONTENT_TYPE |
static String |
JSON_ENCODING |
| Constructor and Description |
|---|
JsonRequest(ActionRequest wrappedRequest) |
| Modifier and Type | Method and Description |
|---|---|
<E> List<E> |
readList(Class<E> elementClass)
Reads a list of objects contained in request.
|
static <E> List<E> |
readList(Reader reader,
Class<E> elementClass) |
<T> T |
readObject(Class<T> targetClass)
Reads an object represented by JSON request.
|
static <T> T |
readObject(Reader reader,
Class<T> targetClass) |
getCookie, getFullRequestUrl, getHeader, getHeaders, getMandatoryParameter, getMandatoryParameter, getMandatoryParameter, getMandatoryParameter, getMetadata, getMethod, getOptionalParameter, getOptionalParameter, getOriginIp, getParameterMap, getPathInfo, getProtocol, getQueryString, getRequestLine, getRequestUri, getRequestUrl, getResponse, getUserAgent, getWrappedRequest, main, putMetadata, removeMetadata, toStringgetServletRequest, getServletResponsepublic static final String JSON_CONTENT_TYPE
public static final String JSON_ENCODING
public JsonRequest(ActionRequest wrappedRequest)
public final <T> T readObject(Class<T> targetClass) throws IOException, BadRequestException
T - object type.targetClass - object class.IOException - if an I/O error happened during the process.BadRequestException - if data contained in the request does not represent an instance of given class.public final <E> List<E> readList(Class<E> elementClass) throws IOException, BadRequestException
E - element type.elementClass - element class.IOException - if an I/O error happened during the process.BadRequestException - if data contained in the request does not represent a list of objects.Copyright © 2017 Agapsys Tecnologia Ltda-ME. All rights reserved.