@Beta public class AtomContent extends AbstractXmlHttpContent
Beta
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.
| Modifier | Constructor and Description |
|---|---|
protected |
AtomContent(XmlNamespaceDictionary namespaceDictionary,
java.lang.Object entry,
boolean isEntry) |
| Modifier and Type | Method and Description |
|---|---|
static AtomContent |
forEntry(XmlNamespaceDictionary namespaceDictionary,
java.lang.Object entry)
Returns a new instance of HTTP content for an Atom entry.
|
static AtomContent |
forFeed(XmlNamespaceDictionary namespaceDictionary,
java.lang.Object feed)
Returns a new instance of HTTP content for an Atom feed.
|
java.lang.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) |
void |
writeTo(org.xmlpull.v1.XmlSerializer serializer)
Writes the content to the given XML serializer.
|
getNamespaceDictionary, writeTocomputeLength, computeLength, getCharset, getLength, getMediaType, getType, retrySupportedprotected AtomContent(XmlNamespaceDictionary namespaceDictionary, java.lang.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 feedpublic static AtomContent forEntry(XmlNamespaceDictionary namespaceDictionary, java.lang.Object entry)
namespaceDictionary - XML namespace dictionaryentry - data key/value pair for the Atom entrypublic static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, java.lang.Object feed)
namespaceDictionary - XML namespace dictionaryfeed - data key/value pair for the Atom feedpublic AtomContent setMediaType(HttpMediaType mediaType)
setMediaType in class AbstractXmlHttpContentpublic final void writeTo(org.xmlpull.v1.XmlSerializer serializer)
throws java.io.IOException
AbstractXmlHttpContentwriteTo in class AbstractXmlHttpContentjava.io.IOException - I/O exceptionpublic final boolean isEntry()
true for an Atom entry or false for an Atom feed.public final java.lang.Object getData()
Copyright © 2011-2018 Google. All Rights Reserved.