public abstract class XmlInputParser<T> extends CharacterParser<T>
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.altFormat, resultType| Constructor and Description |
|---|
XmlInputParser(AltFormat altFormat,
java.lang.Class<T> resultClass)
Creates a new XmlInputParser instance for the provided representation and
result type.
|
| Modifier and Type | Method and Description |
|---|---|
<R extends T> |
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. |
protected abstract <R extends T> |
parse(XmlEventSource eventSource,
InputProperties inProps,
java.lang.Class<R> targetClass)
The parse method should be implemented by subclasses and should parse
input data from the provided
XmlEventSource instance. |
getCharset, parsecreateResult, createResult, getAltFormat, getResultTypepublic <R extends T> R parse(ParseSource parseSource, InputProperties inProps, java.lang.Class<R> targetClass) throws java.io.IOException, ServiceException
CharacterParserReader and then
delegate to the CharacterParser.parse(Reader, InputProperties, Class) method
to perform the parsing.parse in interface InputParser<T>parse in class CharacterParser<T>parseSource - providing the source of the datainProps - properties describing the input datatargetClass - specific type of result expected from the parsejava.io.IOExceptionServiceExceptionprotected abstract <R extends T> R parse(XmlEventSource eventSource, InputProperties inProps, java.lang.Class<R> targetClass) throws java.io.IOException, ServiceException
XmlEventSource instance.R - result typeeventSource - event source.inProps - input properties.targetClass - result type.java.io.IOException - error reading data from event source.ServiceException - parsing error.