com.google.api.client.http.xml
Class AbstractXmlHttpContent

java.lang.Object
  extended by com.google.api.client.http.xml.AbstractXmlHttpContent
All Implemented Interfaces:
HttpContent
Direct Known Subclasses:
AtomContent, AtomContent, AtomFeedContent, AtomFeedContent, XmlHttpContent

public abstract class AbstractXmlHttpContent
extends Object
implements HttpContent

Abstract serializer for XML HTTP content based on the data key/value mapping object for an item.

Since:
1.0
Author:
Yaniv Inbar

Field Summary
 String contentType
          Content type.
 XmlNamespaceDictionary namespaceDictionary
          XML namespace dictionary.
 
Constructor Summary
AbstractXmlHttpContent()
           
 
Method Summary
 String getEncoding()
          Default implementation returns null, but subclasses may override.
 long getLength()
          Default implementation returns -1, but subclasses may override.
 String getType()
          Returns the content type or null for none.
 boolean retrySupported()
          Returns whether or not retry is supported on this content type.
 void writeTo(OutputStream out)
          Writes the content to the given output stream.
protected abstract  void writeTo(org.xmlpull.v1.XmlSerializer serializer)
          Writes the content to the given XML serializer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentType

public String contentType
Content type. Default value is XmlHttpParser.CONTENT_TYPE, though subclasses may define a different default value.


namespaceDictionary

public XmlNamespaceDictionary namespaceDictionary
XML namespace dictionary.

Constructor Detail

AbstractXmlHttpContent

public AbstractXmlHttpContent()
Method Detail

getEncoding

public String getEncoding()
Default implementation returns null, but subclasses may override.

Specified by:
getEncoding in interface HttpContent

getLength

public long getLength()
Default implementation returns -1, but subclasses may override.

Specified by:
getLength in interface HttpContent

getType

public final String getType()
Description copied from interface: HttpContent
Returns the content type or null for none.

Specified by:
getType in interface HttpContent

writeTo

public final void writeTo(OutputStream out)
                   throws IOException
Description copied from interface: HttpContent
Writes the content to the given output stream.

Specified by:
writeTo in interface HttpContent
Throws:
IOException

retrySupported

public boolean retrySupported()
Description copied from interface: HttpContent
Returns whether or not retry is supported on this content type. This is a backward incompatible change that affects versions prior to 1.4.

Specified by:
retrySupported in interface HttpContent

writeTo

protected abstract void writeTo(org.xmlpull.v1.XmlSerializer serializer)
                         throws IOException
Writes the content to the given XML serializer.

Throws:
IOException - I/O exception


Copyright © 2010-2011 Google. All Rights Reserved.