|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.AbstractHttpContent
com.google.api.client.http.json.JsonHttpContent
public class JsonHttpContent
Serializes JSON HTTP content based on the data key/value mapping object for an item.
Sample usage:
static void setContent(HttpRequest request, Object data) {
request.setContent(new JsonHttpContent(new JacksonFactory(), data));
}
Implementation is not thread-safe.
Field Summary | |
---|---|
String |
contentType
Deprecated. (scheduled to be made private in 1.6) Use getType() or setType(java.lang.String) |
Object |
data
Deprecated. (scheduled to be made private final in 1.6) Use getData() |
JsonFactory |
jsonFactory
Deprecated. (scheduled to be made private final in 1.6) Use getJsonFactory() |
Constructor Summary | |
---|---|
JsonHttpContent()
Deprecated. (scheduled to be removed in 1.6) Use JsonHttpContent(JsonFactory, Object) |
|
JsonHttpContent(JsonFactory jsonFactory,
Object data)
|
Method Summary | |
---|---|
Object |
getData()
Returns the JSON key name/value data. |
JsonFactory |
getJsonFactory()
Returns the JSON factory. |
String |
getType()
Returns the content type or null for none. |
JsonHttpContent |
setType(String type)
Sets the content type or null for none. |
void |
writeTo(OutputStream out)
Writes the content to the given output stream. |
Methods inherited from class com.google.api.client.http.AbstractHttpContent |
---|
computeLength, getEncoding, getLength, retrySupported |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public String contentType
getType()
or setType(java.lang.String)
Json.CONTENT_TYPE
.
@Deprecated public Object data
getData()
@Deprecated public JsonFactory jsonFactory
getJsonFactory()
Constructor Detail |
---|
@Deprecated public JsonHttpContent()
JsonHttpContent(JsonFactory, Object)
public JsonHttpContent(JsonFactory jsonFactory, Object data)
jsonFactory
- JSON factory to usedata
- JSON key name/value dataMethod Detail |
---|
public String getType()
HttpContent
null
for none.
public void writeTo(OutputStream out) throws IOException
HttpContent
IOException
public JsonHttpContent setType(String type)
null
for none.
Defaults to Json.CONTENT_TYPE
.
public final Object getData()
public final JsonFactory getJsonFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |