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 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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary) -
Method Summary
Modifier and TypeMethodDescriptionfinal XmlNamespaceDictionaryReturns the XML namespace dictionary.setMediaType(HttpMediaType mediaType) Sets the media type to use for the Content-Type header, ornullif unspecified.final voidwriteTo(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 AbstractHttpContent
computeLength, computeLength, getCharset, getLength, getMediaType, getType, retrySupported
-
Field Details
-
namespaceDictionary
XML namespace dictionary.
-
-
Constructor Details
-
AbstractXmlHttpContent
- Parameters:
namespaceDictionary- XML namespace dictionary- Since:
- 1.5
-
-
Method Details
-
writeTo
Description 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 output stream has not been closed, and will fail to work if it has been closed.
- Parameters:
out- output stream- Throws:
IOException
-
setMediaType
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
Returns the XML namespace dictionary.- Since:
- 1.5
-
writeTo
Writes the content to the given XML serializer.- Throws:
IOException- I/O exception
-