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

java.lang.Object
  extended by com.google.api.client.http.AbstractHttpContent
      extended by com.google.api.client.http.xml.AbstractXmlHttpContent
          extended by com.google.api.client.http.xml.XmlHttpContent
All Implemented Interfaces:
HttpContent

public class XmlHttpContent
extends AbstractXmlHttpContent

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

Sample usage:

 
  static void setContent(HttpRequest request, XmlNamespaceDictionary namespaceDictionary,
      String elementName, Object data) {
    request.setContent(new XmlHttpContent(namespaceDictionary, elementName, data));
  }
 
 

Implementation is not thread-safe.

Since:
1.0
Author:
Yaniv Inbar

Field Summary
 Object data
          Deprecated. (scheduled to be made private final in 1.6) Use getData()
 String elementName
          Deprecated. (scheduled to be made private final in 1.6) Use getElementName()
 
Fields inherited from class com.google.api.client.http.xml.AbstractXmlHttpContent
contentType, namespaceDictionary
 
Constructor Summary
XmlHttpContent()
          Deprecated. (scheduled to be removed in 1.6) Use XmlHttpContent(XmlNamespaceDictionary, String, Object)
XmlHttpContent(XmlNamespaceDictionary namespaceDictionary, String elementName, Object data)
          XML namespace dictionary.
 
Method Summary
 Object getData()
          Returns the key/value pair data.
 String getElementName()
          Returns the XML element local name, optionally prefixed by its namespace alias, for example "atom:entry".
 XmlHttpContent setType(String type)
          Sets the content type or null for none.
 void writeTo(org.xmlpull.v1.XmlSerializer serializer)
          Writes the content to the given XML serializer.
 
Methods inherited from class com.google.api.client.http.xml.AbstractXmlHttpContent
getNamespaceDictionary, getType, writeTo
 
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

elementName

@Deprecated
public String elementName
Deprecated. (scheduled to be made private final in 1.6) Use getElementName()
XML element local name, optionally prefixed by its namespace alias, for example "atom:entry".


data

@Deprecated
public Object data
Deprecated. (scheduled to be made private final in 1.6) Use getData()
Key/value pair data.

Constructor Detail

XmlHttpContent

@Deprecated
public XmlHttpContent()
Deprecated. (scheduled to be removed in 1.6) Use XmlHttpContent(XmlNamespaceDictionary, String, Object)


XmlHttpContent

public XmlHttpContent(XmlNamespaceDictionary namespaceDictionary,
                      String elementName,
                      Object data)
XML namespace dictionary.

Parameters:
namespaceDictionary - XML namespace dictionary
elementName - XML element local name, optionally prefixed by its namespace alias, for example "atom:entry"
data - Key/value pair data
Since:
1.5
Method Detail

setType

public XmlHttpContent setType(String type)
Description copied from class: AbstractXmlHttpContent
Sets the content type or null for none.

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

Overrides:
setType in class AbstractXmlHttpContent

writeTo

public final void writeTo(org.xmlpull.v1.XmlSerializer serializer)
                   throws IOException
Description copied from class: AbstractXmlHttpContent
Writes the content to the given XML serializer.

Specified by:
writeTo in class AbstractXmlHttpContent
Throws:
IOException - I/O exception

getElementName

public final String getElementName()
Returns the XML element local name, optionally prefixed by its namespace alias, for example "atom:entry".

Since:
1.5

getData

public final Object getData()
Returns the key/value pair data.

Since:
1.5


Copyright © 2011 Google. All Rights Reserved.