public class GsonHttpSerializer extends JsonHttpSerializer
HttpObjectSerializer.SerializerException| Constructor and Description |
|---|
GsonHttpSerializer() |
| Modifier and Type | Method and Description |
|---|---|
protected com.google.gson.Gson |
getGson() |
<T> List<T> |
getJsonList(InputStream json,
String charset,
Class<T> elementType) |
<T> T |
readObject(InputStream json,
String charset,
Class<T> targetClass) |
String |
toString(Object obj)
Returns the string representation of an object.
|
getCharset, getContentType, getJsonList, toJsonreadObject, writeObjectprotected com.google.gson.Gson getGson()
public <T> T readObject(InputStream json, String charset, Class<T> targetClass) throws HttpObjectSerializer.SerializerException, IOException
readObject in class HttpObjectSerializerT - Type of the returned objectjson - input streamcharset - charsettargetClass - class of returned objectHttpObjectSerializer.SerializerException - if it was not possible to retrieve an object instance from given input streamIOException - if an error happened during the operationpublic <T> List<T> getJsonList(InputStream json, String charset, Class<T> elementType) throws IOException, HttpObjectSerializer.SerializerException
getJsonList in class JsonHttpSerializerIOExceptionHttpObjectSerializer.SerializerExceptionpublic String toString(Object obj)
HttpObjectSerializertoString in class HttpObjectSerializerobj - object to be converted.Copyright © 2016 Agapsys Tecnologia Ltda-ME. All rights reserved.