public class ElementParser<T> extends CharacterParser<T>
InputParser
implementation for
Element
data model types.altFormat, resultType
Modifier | Constructor and Description |
---|---|
protected |
ElementParser(AltFormat altFormat,
java.lang.Class<T> resultType)
Constructs a new ElementParser instance for parsing content in a a
particular representation to produce results of a specified type.
|
Modifier and Type | Method and Description |
---|---|
static <T> ElementParser<T> |
of(AltFormat altFormat,
java.lang.Class<T> resultType)
Provides a factory method to create a new
ElementParser that
handles a particular representation to produce a particular type of
result. |
<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.
|
getCharset, parse
createResult, createResult, getAltFormat, getResultType
protected ElementParser(AltFormat altFormat, java.lang.Class<T> resultType)
altFormat
- parsed alternate representationresultType
- expected result typejava.lang.IllegalArgumentException
- if the representation does not have an
associated wire format that can be used to parse the content.public static <T> ElementParser<T> of(AltFormat altFormat, java.lang.Class<T> resultType)
ElementParser
that
handles a particular representation to produce a particular type of
result.T
- base type of parse result objectsaltFormat
- alternate representation parsedresultType
- type of result object producedjava.lang.IllegalArgumentException
- if the representation does not have an
associated wire format that can be used to parse the content.public <R extends T> R parse(java.io.Reader inputReader, InputProperties inProps, java.lang.Class<R> resultClass) throws java.io.IOException, ServiceException
CharacterParser
Reader
.parse
in class CharacterParser<T>
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