public abstract class

CharacterParser

extends AbstractParser<T>
java.lang.Object
   ↳ com.google.gdata.wireformats.input.AbstractParser<T>
     ↳ com.google.gdata.wireformats.input.CharacterParser<T>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The CharacterParser class is abstract base class to support the implementation of an 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.

Summary

[Expand]
Inherited Fields
From class com.google.gdata.wireformats.input.AbstractParser
Protected Constructors
CharacterParser(AltFormat altFormat, Class<T> resultClass)
Constructs a new CharacterParser that parses content in a particular alt format and returns instances of the specified type.
Public Methods
abstract <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.
<R extends T> R parse(ParseSource parseSource, InputProperties inProps, 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.
Protected Methods
String getCharset(InputProperties inProps)
Returns the expected character set encoding for content based upon the input properties content type.
[Expand]
Inherited Methods
From class com.google.gdata.wireformats.input.AbstractParser
From class java.lang.Object
From interface com.google.gdata.wireformats.input.InputParser

Protected Constructors

protected CharacterParser (AltFormat altFormat, Class<T> resultClass)

Constructs a new CharacterParser that parses content in a particular alt format and returns instances of the specified type.

Parameters
altFormat Representation handled by this parser
resultClass Base type of results produced by parser.

Public Methods

public abstract 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.
Returns
  • result object from parse
Throws
IOException if an error occurred reading data while parsing
ServiceException if an error occurred within the content

public R parse (ParseSource parseSource, InputProperties inProps, 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.

Parameters
parseSource
inProps
targetClass
Throws
IOException
ServiceException

Protected Methods

protected String getCharset (InputProperties inProps)

Returns the expected character set encoding for content based upon the input properties content type.

Parameters
inProps Input properties
Returns
  • expected character set encoding