|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.wireformats.input.AbstractParser<T>
public abstract class AbstractParser<T>
The AbstractParser class is an abstract base class that can be used in the
creation of new InputParser
implementations. It provides the
basic storage and getters for the alternate representation and result type
and utility code for constructing new result type implementation instances.
Field Summary | |
---|---|
protected AltFormat |
altFormat
|
protected java.lang.Class<? extends T> |
resultType
|
Constructor Summary | |
---|---|
protected |
AbstractParser(AltFormat altFormat,
java.lang.Class<? extends T> resultType)
Constructs a new AbstractParser instance for the specified representation and result type. |
Method Summary | ||
---|---|---|
protected T |
createResult()
Creates a new result object instance using the result type passed to the constructor. |
|
protected
|
createResult(java.lang.Class<R> resultImplClass)
Creates a new result object instance using the provided result implementation class. |
|
AltFormat |
getAltFormat()
Returns the alternate representation format that is expected as input to the parser. |
|
java.lang.Class<? extends T> |
getResultType()
Returns the target type that is populated by the parser from the input stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.gdata.wireformats.input.InputParser |
---|
parse |
Field Detail |
---|
protected final AltFormat altFormat
protected final java.lang.Class<? extends T> resultType
Constructor Detail |
---|
protected AbstractParser(AltFormat altFormat, java.lang.Class<? extends T> resultType)
altFormat
- parsed alternate representationresultType
- type of resultMethod Detail |
---|
public AltFormat getAltFormat()
InputParser
getAltFormat
in interface InputParser<T>
public java.lang.Class<? extends T> getResultType()
InputParser
getResultType
in interface InputParser<T>
protected T createResult() throws ContentCreationException
ContentCreationException
protected <R extends T> R createResult(java.lang.Class<R> resultImplClass) throws ContentCreationException
R
- type of the created resultresultImplClass
- Result implementation class. The type must implement
the result type of the parser and provide a null argument
constructor.
ContentCreationException
- if unable to create result object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |