com.google.gdata.wireformats.input
Class XmlInputParser<T>

java.lang.Object
  extended by com.google.gdata.wireformats.input.AbstractParser<T>
      extended by com.google.gdata.wireformats.input.CharacterParser<T>
          extended by com.google.gdata.wireformats.input.XmlInputParser<T>
All Implemented Interfaces:
InputParser<T>
Direct Known Subclasses:
AtomDataParser, AtomServiceDataParser

public abstract class XmlInputParser<T>
extends CharacterParser<T>

The XmlInputParser class is an abstract base class supporting the creation of new InputParser implementations that parse XML content. Concrete class will need to implement the both the CharacterParser.parse(Reader, InputProperties, Class) and parse(XmlEventSource, InputProperties, Class) methods to handle parsing from the two possible source types.


Constructor Summary
XmlInputParser(AltFormat altFormat, java.lang.Class<T> resultClass)
          Creates a new XmlInputParser instance for the provided representation and result type.
 
Method Summary
<R extends T>
R
parse(ParseSource parseSource, InputProperties inProps, java.lang.Class<R> targetClass)
          The parse method will use the character encoding found in the output properties instance to construct an appropriate Reader and then delegate to the CharacterParser.parse(Reader, InputProperties, Class) method to perform the parsing.
 
Methods inherited from class com.google.gdata.wireformats.input.CharacterParser
parse
 
Methods inherited from class com.google.gdata.wireformats.input.AbstractParser
getAltFormat, getResultType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlInputParser

public XmlInputParser(AltFormat altFormat,
                      java.lang.Class<T> resultClass)
Creates a new XmlInputParser instance for the provided representation and result type.

Parameters:
altFormat - parsed representation.
resultClass - parser output result type.
Method Detail

parse

public <R extends T> R parse(ParseSource parseSource,
                             InputProperties inProps,
                             java.lang.Class<R> targetClass)
                  throws java.io.IOException,
                         ServiceException
Description copied from class: CharacterParser
The parse method will use the character encoding found in the output properties instance to construct an appropriate Reader and then delegate to the CharacterParser.parse(Reader, InputProperties, Class) method to perform the parsing.

Specified by:
parse in interface InputParser<T>
Overrides:
parse in class CharacterParser<T>
Parameters:
parseSource - providing the source of the data
inProps - properties describing the input data
targetClass - specific type of result expected from the parse
Throws:
java.io.IOException
ServiceException