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

java.lang.Object
  extended by com.google.api.client.http.xml.XmlHttpParser
All Implemented Interfaces:
HttpParser
Direct Known Subclasses:
AtomParser, AtomParser

public class XmlHttpParser
extends Object
implements HttpParser

XML HTTP parser into an data class of key/value pairs.

Sample usage:

 
  static void setParser(HttpTransport transport) {
    XmlHttpParser parser = new XmlHttpParser();
    parser.namespaceDictionary = NAMESPACE_DICTIONARY;
    transport.addParser(parser);
  }
 
 

Since:
1.0
Author:
Yaniv Inbar

Field Summary
static String CONTENT_TYPE
          "application/xml" content type.
 String contentType
          Content type.
 XmlNamespaceDictionary namespaceDictionary
          XML namespace dictionary.
 
Constructor Summary
XmlHttpParser()
           
 
Method Summary
 String getContentType()
          Returns the content type.
<T> T
parse(HttpResponse response, Class<T> dataClass)
          Default implementation parses the content of the response into the data class of key/value pairs, but subclasses may override.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_TYPE

public static final String CONTENT_TYPE
"application/xml" content type.

See Also:
Constant Field Values

contentType

public String contentType
Content type. Default value is CONTENT_TYPE.


namespaceDictionary

public XmlNamespaceDictionary namespaceDictionary
XML namespace dictionary.

Constructor Detail

XmlHttpParser

public XmlHttpParser()
Method Detail

getContentType

public final String getContentType()
Description copied from interface: HttpParser
Returns the content type.

Specified by:
getContentType in interface HttpParser

parse

public <T> T parse(HttpResponse response,
                   Class<T> dataClass)
        throws IOException
Default implementation parses the content of the response into the data class of key/value pairs, but subclasses may override.

Specified by:
parse in interface HttpParser
Throws:
IOException


Copyright © 2010-2011 Google. All Rights Reserved.