|
||||||||||
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.xml.AbstractXmlHttpContent
com.google.api.client.http.xml.XmlHttpContent
public class XmlHttpContent
Serializes XML HTTP content based on the data key/value mapping object for an item.
Sample usage:
static void setContent(HttpRequest request, XmlNamespaceDictionary namespaceDictionary,
String elementName, Object data) {
request.setContent(new XmlHttpContent(namespaceDictionary, elementName, data));
}
Implementation is not thread-safe.
Constructor Summary | |
---|---|
XmlHttpContent(XmlNamespaceDictionary namespaceDictionary,
String elementName,
Object data)
XML namespace dictionary. |
Method Summary | |
---|---|
Object |
getData()
Returns the key/value pair data. |
String |
getElementName()
Returns the XML element local name, optionally prefixed by its namespace alias, for example "atom:entry" . |
XmlHttpContent |
setMediaType(HttpMediaType mediaType)
Sets the media type to use for the Content-Type header, or null if unspecified. |
XmlHttpContent |
setType(String type)
Deprecated. (scheduled to be removed in 1.11) Use setMediaType(HttpMediaType) instead. |
void |
writeTo(org.xmlpull.v1.XmlSerializer serializer)
Writes the content to the given XML serializer. |
Methods inherited from class com.google.api.client.http.xml.AbstractXmlHttpContent |
---|
getNamespaceDictionary, writeTo |
Methods inherited from class com.google.api.client.http.AbstractHttpContent |
---|
computeLength, getCharset, getEncoding, getLength, getMediaType, getType, retrySupported |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlHttpContent(XmlNamespaceDictionary namespaceDictionary, String elementName, Object data)
namespaceDictionary
- XML namespace dictionaryelementName
- XML element local name, optionally prefixed by its namespace alias, for
example "atom:entry"
data
- Key/value pair dataMethod Detail |
---|
@Deprecated public XmlHttpContent setType(String type)
setMediaType(HttpMediaType)
instead.
null
for none. Will override any pre-set media type parameter.
Defaults to Xml.MEDIA_TYPE
, though subclasses may define a different default value.
setType
in class AbstractXmlHttpContent
public final void writeTo(org.xmlpull.v1.XmlSerializer serializer) throws IOException
AbstractXmlHttpContent
writeTo
in class AbstractXmlHttpContent
IOException
- I/O exceptionpublic XmlHttpContent setMediaType(HttpMediaType mediaType)
AbstractHttpContent
null
if unspecified.
This will also overwrite any previously set parameter of the media type (for example
"charset"
), and therefore might change other properties as well.
setMediaType
in class AbstractXmlHttpContent
public final String getElementName()
"atom:entry"
.
public final Object getData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |