com.google.api.client.googleapis.json
Class JsonCContent
java.lang.Object
com.google.api.client.http.AbstractHttpContent
com.google.api.client.http.json.JsonHttpContent
com.google.api.client.googleapis.json.JsonCContent
- All Implemented Interfaces:
- HttpContent
public final class JsonCContent
- extends JsonHttpContent
Serializes JSON-C content based on the data key/value mapping object for an item, wrapped in a
"data"
envelope.
Warning: this should only be used by some older Google APIs that wrapped the response in a "data"
envelope. All newer Google APIs don't use this envelope, and for those APIs
JsonHttpContent
should be used instead.
Sample usage:
static void setContent(HttpRequest request, Object data) {
JsonCContent content = new JsonCContent();
content.jsonFactory = new JacksonFactory();
content.data = data;
request.content = content;
}
- Since:
- 1.0
- Author:
- Yaniv Inbar
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsonCContent
public JsonCContent(JsonFactory jsonFactory,
Object data)
- Parameters:
jsonFactory
- JSON factory to usedata
- JSON key name/value data- Since:
- 1.5
writeTo
public void writeTo(OutputStream out)
throws IOException
- Specified by:
writeTo
in interface HttpContent
- Overrides:
writeTo
in class JsonHttpContent
- Throws:
IOException
Copyright © 2010-2011 Google. All Rights Reserved.