Class GsonObjectParser
- java.lang.Object
-
- in.ashwanthkumar.gocd.client.http.GsonObjectParser
-
- All Implemented Interfaces:
com.google.api.client.util.ObjectParser
public class GsonObjectParser extends Object implements com.google.api.client.util.ObjectParser
ObjectParser implementation to be used along with google-http-client backed by Gson.
The default implementation doesn't work at all for some reason, and I'm not sure either why the whole json parsing was re-invented in the http-client instead of just delegating it to the underlying framework.
I'm just going to assume Google engineers are way smarter than me but it's just that I don't know how to use the in-built
new JsonObjectParser(new GsonFactory).
-
-
Constructor Summary
Constructors Constructor Description GsonObjectParser(com.google.gson.Gson gson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TparseAndClose(InputStream in, Charset charset, Class<T> dataClass)ObjectparseAndClose(InputStream in, Charset charset, Type dataType)<T> TparseAndClose(Reader reader, Class<T> dataClass)ObjectparseAndClose(Reader reader, Type dataType)
-
-
-
Method Detail
-
parseAndClose
public <T> T parseAndClose(InputStream in, Charset charset, Class<T> dataClass) throws IOException
- Specified by:
parseAndClosein interfacecom.google.api.client.util.ObjectParser- Throws:
IOException
-
parseAndClose
public Object parseAndClose(InputStream in, Charset charset, Type dataType) throws IOException
- Specified by:
parseAndClosein interfacecom.google.api.client.util.ObjectParser- Throws:
IOException
-
parseAndClose
public <T> T parseAndClose(Reader reader, Class<T> dataClass) throws IOException
- Specified by:
parseAndClosein interfacecom.google.api.client.util.ObjectParser- Throws:
IOException
-
parseAndClose
public Object parseAndClose(Reader reader, Type dataType) throws IOException
- Specified by:
parseAndClosein interfacecom.google.api.client.util.ObjectParser- Throws:
IOException
-
-