|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.xml.XmlHttpParser
public class XmlHttpParser
XML HTTP parser into an data class of key/value pairs.
Implementation is thread-safe as long as the fields are not set directly (which is deprecated usage).
Sample usage:
static void setParser(HttpRequest request, XmlNamespaceDictionary namespaceDictionary) {
request.addParser(new XmlHttpParser(namespaceDictionary));
}
Nested Class Summary | |
---|---|
static class |
XmlHttpParser.Builder
Builder for XmlHttpParser . |
Field Summary | |
---|---|
static String |
CONTENT_TYPE
"application/xml" content type. |
String |
contentType
Deprecated. (scheduled to be made private final in 1.6) Use getContentType() or
XmlHttpParser.Builder.setContentType(java.lang.String) |
XmlNamespaceDictionary |
namespaceDictionary
Deprecated. (scheduled to be made private final in 1.6) Use getNamespaceDictionary() |
Constructor Summary | |
---|---|
|
XmlHttpParser()
Deprecated. (scheduled to be removed in 1.6) Use XmlHttpParser(XmlNamespaceDictionary) |
|
XmlHttpParser(XmlNamespaceDictionary namespaceDictionary)
|
protected |
XmlHttpParser(XmlNamespaceDictionary namespaceDictionary,
String contentType)
|
Method Summary | ||
---|---|---|
static XmlHttpParser.Builder |
builder(XmlNamespaceDictionary namespaceDictionary)
Returns an instance of a new builder. |
|
String |
getContentType()
Returns the content type. |
|
XmlNamespaceDictionary |
getNamespaceDictionary()
Returns the XML namespace dictionary. |
|
|
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 |
---|
public static final String CONTENT_TYPE
"application/xml"
content type.
@Deprecated public String contentType
getContentType()
or
XmlHttpParser.Builder.setContentType(java.lang.String)
CONTENT_TYPE
.
@Deprecated public XmlNamespaceDictionary namespaceDictionary
getNamespaceDictionary()
Constructor Detail |
---|
@Deprecated public XmlHttpParser()
XmlHttpParser(XmlNamespaceDictionary)
public XmlHttpParser(XmlNamespaceDictionary namespaceDictionary)
namespaceDictionary
- XML namespace dictionaryprotected XmlHttpParser(XmlNamespaceDictionary namespaceDictionary, String contentType)
namespaceDictionary
- XML namespace dictionarycontentType
- content type or null
for noneMethod Detail |
---|
public final String getContentType()
HttpParser
getContentType
in interface HttpParser
public <T> T parse(HttpResponse response, Class<T> dataClass) throws IOException
parse
in interface HttpParser
IOException
public final XmlNamespaceDictionary getNamespaceDictionary()
public static XmlHttpParser.Builder builder(XmlNamespaceDictionary namespaceDictionary)
namespaceDictionary
- XML namespace dictionary
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |