Class XmlObjectParser (1.42.3)

public class XmlObjectParser implements ObjectParser

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

Implementation is thread-safe.

Sample usage:

static void setParser(HttpRequest request, XmlNamespaceDictionary namespaceDictionary) { request.setParser(new XmlObjectParser(namespaceDictionary)); }

Inheritance

Object > XmlObjectParser

Implements

ObjectParser

Constructors

XmlObjectParser(XmlNamespaceDictionary namespaceDictionary)

public XmlObjectParser(XmlNamespaceDictionary namespaceDictionary)

Creates an XmlObjectParser using the specified non-null namespace dictionary.

Parameter
NameDescription
namespaceDictionaryXmlNamespaceDictionary

XML namespace dictionary

Methods

<T>parseAndClose(InputStream in, Charset charset, Class<T> dataClass)

public T <T>parseAndClose(InputStream in, Charset charset, Class<T> dataClass)

Parses the given input stream into a new instance of the the given data class of key/value pairs and closes the input stream.

Parameters
NameDescription
inInputStream
charsetCharset
dataClassClass<T>
Returns
TypeDescription
T
Exceptions
TypeDescription
IOException

<T>parseAndClose(Reader reader, Class<T> dataClass)

public T <T>parseAndClose(Reader reader, Class<T> dataClass)

Parses the given reader into a new instance of the the given data class of key/value pairs and closes the reader.

Parameters
NameDescription
readerReader
dataClassClass<T>
Returns
TypeDescription
T
Exceptions
TypeDescription
IOException

getNamespaceDictionary()

public final XmlNamespaceDictionary getNamespaceDictionary()

Returns the XML namespace dictionary.

Returns
TypeDescription
XmlNamespaceDictionary

parseAndClose(InputStream in, Charset charset, Type dataType)

public Object parseAndClose(InputStream in, Charset charset, Type dataType)

Parses the given input stream into a new instance of the the given data type of key/value pairs and closes the input stream.

Parameters
NameDescription
inInputStream
charsetCharset
dataTypeType
Returns
TypeDescription
Object
Exceptions
TypeDescription
IOException

parseAndClose(Reader reader, Type dataType)

public Object parseAndClose(Reader reader, Type dataType)

Parses the given reader into a new instance of the the given data type of key/value pairs and closes the reader.

Parameters
NameDescription
readerReader
dataTypeType
Returns
TypeDescription
Object
Exceptions
TypeDescription
IOException