Class Overview
The ElementParser class is a generic InputParser implementation for
Element data model types.
Summary
| Protected Constructors |
|
|
ElementParser(AltFormat altFormat, Class<T> resultType)
Constructs a new ElementParser instance for parsing content in a a
particular representation to produce results of a specified type.
|
| Public Methods |
|
static
<T>
ElementParser<T>
|
of(AltFormat altFormat, 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>
R
|
parse(Reader inputReader, InputProperties inProps, Class<R> resultClass)
Parses character content with the specified properties to produce a result
of an expected type.
|
Protected Constructors
protected
ElementParser
(AltFormat altFormat, Class<T> resultType)
Constructs a new ElementParser instance for parsing content in a a
particular representation to produce results of a specified type.
Parameters
| altFormat
| Parsed alternate representation |
| resultType
| Expected result type |
Throws
| IllegalArgumentException
| if the representation does not have an
associated wire format that can be used to parse the content.
|
Public Methods
public
static
ElementParser<T>
of
(AltFormat altFormat, Class<T> resultType)
Provides a factory method to create a new ElementParser that
handles a particular representation to produce a particular type of
result.
Parameters
| altFormat
| Alternate representation parsed |
| resultType
| Type of result object produced |
Returns
- an element parser with the desired configuration
Throws
| IllegalArgumentException
| if the representation does not have an
associated wire format that can be used to parse the content.
|
public
R
parse
(Reader inputReader, InputProperties inProps, Class<R> resultClass)
Parses character content with the specified properties to produce a result
of an expected type. Concrete subclasses will provide an implementation
of this method that constructs a result type instance of the result class
and then parses into it from the provided Reader.
Parameters
| inputReader
| Reader to parse data from |
| inProps
| Input properties |
| resultClass
| Class to instantiate and parse result into. |