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 and Description |
|---|
GsonObjectParser(com.google.gson.Gson gson) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
parseAndClose(InputStream in,
Charset charset,
Class<T> dataClass) |
Object |
parseAndClose(InputStream in,
Charset charset,
Type dataType) |
<T> T |
parseAndClose(Reader reader,
Class<T> dataClass) |
Object |
parseAndClose(Reader reader,
Type dataType) |
public <T> T parseAndClose(InputStream in, Charset charset, Class<T> dataClass) throws IOException
parseAndClose in interface com.google.api.client.util.ObjectParserIOExceptionpublic Object parseAndClose(InputStream in, Charset charset, Type dataType) throws IOException
parseAndClose in interface com.google.api.client.util.ObjectParserIOExceptionpublic <T> T parseAndClose(Reader reader, Class<T> dataClass) throws IOException
parseAndClose in interface com.google.api.client.util.ObjectParserIOExceptionpublic Object parseAndClose(Reader reader, Type dataType) throws IOException
parseAndClose in interface com.google.api.client.util.ObjectParserIOExceptionCopyright © 2016. All rights reserved.