Package com.google.api.client.http.xml
Class AbstractXmlHttpContent
- java.lang.Object
-
- com.google.api.client.http.AbstractHttpContent
-
- com.google.api.client.http.xml.AbstractXmlHttpContent
-
- All Implemented Interfaces:
HttpContent,StreamingContent
- Direct Known Subclasses:
AtomContent,XmlHttpContent
@Beta public abstract class AbstractXmlHttpContent extends AbstractHttpContent
Beta
Abstract serializer for XML HTTP content based on the data key/value mapping object for an item.Implementation is not thread-safe.
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private XmlNamespaceDictionarynamespaceDictionaryXML namespace dictionary.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description XmlNamespaceDictionarygetNamespaceDictionary()Returns the XML namespace dictionary.AbstractXmlHttpContentsetMediaType(HttpMediaType mediaType)Sets the media type to use for the Content-Type header, ornullif unspecified.voidwriteTo(java.io.OutputStream out)Writes the byte content to the given output stream.protected abstract voidwriteTo(org.xmlpull.v1.XmlSerializer serializer)Writes the content to the given XML serializer.-
Methods inherited from class com.google.api.client.http.AbstractHttpContent
computeLength, computeLength, getCharset, getLength, getMediaType, getType, retrySupported
-
-
-
-
Field Detail
-
namespaceDictionary
private final XmlNamespaceDictionary namespaceDictionary
XML namespace dictionary.
-
-
Constructor Detail
-
AbstractXmlHttpContent
protected AbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary)
- Parameters:
namespaceDictionary- XML namespace dictionary- Since:
- 1.5
-
-
Method Detail
-
writeTo
public final void writeTo(java.io.OutputStream out) throws java.io.IOExceptionDescription copied from interface:StreamingContentWrites the byte content to the given output stream.Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the the output stream has not been closed, and will fail to work if it has been closed.
- Parameters:
out- output stream- Throws:
java.io.IOException
-
setMediaType
public AbstractXmlHttpContent setMediaType(HttpMediaType mediaType)
Description copied from class:AbstractHttpContentSets the media type to use for the Content-Type header, ornullif unspecified.This will also overwrite any previously set parameter of the media type (for example
"charset"), and therefore might change other properties as well.- Overrides:
setMediaTypein classAbstractHttpContent
-
getNamespaceDictionary
public final XmlNamespaceDictionary getNamespaceDictionary()
Returns the XML namespace dictionary.- Since:
- 1.5
-
writeTo
protected abstract void writeTo(org.xmlpull.v1.XmlSerializer serializer) throws java.io.IOExceptionWrites the content to the given XML serializer.- Throws:
java.io.IOException- I/O exception
-
-