public class GsonResponseParser<T> extends Object implements ResponseParser<T>
| Constructor and Description |
|---|
GsonResponseParser() |
GsonResponseParser(com.google.gson.Gson gson) |
| Modifier and Type | Method and Description |
|---|---|
com.google.gson.Gson |
getGson()
Deprecated.
This method exists to support another deprecated method while
we transition off of it.
PipeConfig.setGsonBuilder(com.google.gson.GsonBuilder) |
MarshallingConfig |
getMarshallingConfig()
The marshalling config sets options for reading and processing data
|
T[] |
handleArrayResponse(String response,
Class<T[]> responseType)
UnMarshall a response and return an object array.
|
List<T> |
handleResponse(HeaderAndBody httpResponse,
Class<T> responseType) |
T |
handleResponse(String response,
Class<T> responseType)
UnMarshall a response and return an object instance.
|
void |
setGson(com.google.gson.Gson gson)
Deprecated.
This method exists to support another deprecated method while
we transition off of it.
PipeConfig.setGsonBuilder(com.google.gson.GsonBuilder) |
void |
setMarshallingConfig(MarshallingConfig marshallingConfig) |
public GsonResponseParser()
public GsonResponseParser(com.google.gson.Gson gson)
public T handleResponse(String response, Class<T> responseType)
ResponseParserhandleResponse in interface ResponseParser<T>response - the data from the serverresponseType - the type to marshal topublic T[] handleArrayResponse(String response, Class<T[]> responseType)
ResponseParserhandleArrayResponse in interface ResponseParser<T>response - the data from the serverresponseType - the type to marshal topublic List<T> handleResponse(HeaderAndBody httpResponse, Class<T> responseType)
handleResponse in interface ResponseParser<T>@Deprecated public com.google.gson.Gson getGson()
PipeConfig.setGsonBuilder(com.google.gson.GsonBuilder)@Deprecated public void setGson(com.google.gson.Gson gson)
PipeConfig.setGsonBuilder(com.google.gson.GsonBuilder)gson - the gson serializer to usepublic MarshallingConfig getMarshallingConfig()
getMarshallingConfig in interface ResponseParser<T>public void setMarshallingConfig(MarshallingConfig marshallingConfig)
Copyright © 2014 JBoss by Red Hat. All rights reserved.