|
||||||||||
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.atom.AtomContent
public class AtomContent
Serializes Atom XML HTTP content based on the data key/value mapping object for an Atom entry.
Default value for AbstractHttpContent.getType()
is Atom.MEDIA_TYPE
.
Sample usages:
static void setAtomEntryContent(
HttpRequest request, XmlNamespaceDictionary namespaceDictionary, Object entry) {
request.setContent(AtomContent.forEntry(namespaceDictionary, entry));
}
static void setAtomBatchContent(
HttpRequest request, XmlNamespaceDictionary namespaceDictionary, Object batchFeed) {
request.setContent(AtomContent.forFeed(namespaceDictionary, batchFeed));
}
Implementation is not thread-safe.
Constructor Summary | |
---|---|
protected |
AtomContent(XmlNamespaceDictionary namespaceDictionary,
Object entry,
boolean isEntry)
|
Method Summary | |
---|---|
static AtomContent |
forEntry(XmlNamespaceDictionary namespaceDictionary,
Object entry)
Returns a new instance of HTTP content for an Atom entry. |
static AtomContent |
forFeed(XmlNamespaceDictionary namespaceDictionary,
Object feed)
Returns a new instance of HTTP content for an Atom feed. |
Object |
getData()
Returns the key name/value pair data for the Atom entry or Atom feed. |
boolean |
isEntry()
Returns true for an Atom entry or false for an Atom feed. |
AtomContent |
setMediaType(HttpMediaType mediaType)
Sets the media type to use for the Content-Type header, or null if unspecified. |
AtomContent |
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 |
---|
protected AtomContent(XmlNamespaceDictionary namespaceDictionary, Object entry, boolean isEntry)
namespaceDictionary
- XML namespace dictionaryentry
- key/value pair data for the Atom entryisEntry
- true
for an Atom entry or false
for an Atom feedMethod Detail |
---|
public static AtomContent forEntry(XmlNamespaceDictionary namespaceDictionary, Object entry)
namespaceDictionary
- XML namespace dictionaryentry
- data key/value pair for the Atom entrypublic static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, Object feed)
namespaceDictionary
- XML namespace dictionaryfeed
- data key/value pair for the Atom feed@Deprecated public AtomContent 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 AtomContent 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 void writeTo(org.xmlpull.v1.XmlSerializer serializer) throws IOException
AbstractXmlHttpContent
writeTo
in class AbstractXmlHttpContent
IOException
- I/O exceptionpublic final boolean isEntry()
true
for an Atom entry or false
for an Atom feed.
public final Object getData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |