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

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

public abstract class AbstractXmlHttpContent
extends AbstractHttpContent

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
Author:
Yaniv Inbar

Field Summary
 String contentType
          Deprecated. (scheduled to be made private in 1.6) Use getType() or setType(java.lang.String)
 XmlNamespaceDictionary namespaceDictionary
          Deprecated. (scheduled to be made private final in 1.6) Use getNamespaceDictionary()
 
Constructor Summary
  AbstractXmlHttpContent()
          Deprecated. (scheduled to be removed in 1.6) Use AbstractXmlHttpContent(XmlNamespaceDictionary)
protected AbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary)
           
 
Method Summary
 XmlNamespaceDictionary getNamespaceDictionary()
          Returns the XML namespace dictionary.
 String getType()
          Returns the content type or null for none.
 AbstractXmlHttpContent setType(String type)
          Sets the content type or null for none.
 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 com.google.api.client.http.AbstractHttpContent
computeLength, getEncoding, getLength, retrySupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentType

@Deprecated
public String contentType
Deprecated. (scheduled to be made private in 1.6) Use getType() or setType(java.lang.String)
Content type. Default value is XmlHttpParser.CONTENT_TYPE, though subclasses may define a different default value.


namespaceDictionary

@Deprecated
public XmlNamespaceDictionary namespaceDictionary
Deprecated. (scheduled to be made private final in 1.6) Use getNamespaceDictionary()
XML namespace dictionary.

Constructor Detail

AbstractXmlHttpContent

@Deprecated
public AbstractXmlHttpContent()
Deprecated. (scheduled to be removed in 1.6) Use AbstractXmlHttpContent(XmlNamespaceDictionary)


AbstractXmlHttpContent

protected AbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary)
Parameters:
namespaceDictionary - XML namespace dictionary
Since:
1.5
Method Detail

getType

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


writeTo

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

Throws:
IOException

setType

public AbstractXmlHttpContent setType(String type)
Sets the content type or null for none.

Defaults to XmlHttpParser.CONTENT_TYPE, though subclasses may define a different default value.

Since:
1.5

getNamespaceDictionary

public final XmlNamespaceDictionary getNamespaceDictionary()
Returns the XML namespace dictionary.

Since:
1.5

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 © 2011 Google. All Rights Reserved.