public abstract class CharacterParser<T> extends AbstractParser<T>
InputParser
for character-based content types.
It encapsulates the code for mapping from an InputStream
to an
Reader
based upon the input content type and then delegates to the
abstract parse(Reader, InputProperties, Class)
method to handle
the actual parsing of the character data.
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 parse(Reader, InputProperties, Class) method
to perform the parsing. |
abstract <R extends T> |
parse(java.io.Reader inputReader,
InputProperties inProps,
java.lang.Class<R> resultClass)
Parses character content with the specified properties to produce a result
of an expected type.
|
getAltFormat, getResultType
public <R extends T> R parse(ParseSource parseSource, InputProperties inProps, java.lang.Class<R> targetClass) throws java.io.IOException, ServiceException
Reader
and then
delegate to the parse(Reader, InputProperties, Class)
method
to perform the parsing.parseSource
- providing the source of the datainProps
- properties describing the input datatargetClass
- specific type of result expected from the parsejava.io.IOException
ServiceException
public abstract <R extends T> R parse(java.io.Reader inputReader, InputProperties inProps, java.lang.Class<R> resultClass) throws java.io.IOException, ServiceException
Reader
.R
- expected result typeinputReader
- reader to parse data frominProps
- input propertiesresultClass
- class to instantiate and parse result into.java.io.IOException
- if an error occurred reading data while parsingServiceException
- if an error occurred within the content