public abstract class

CharacterGenerator

extends Object
implements OutputGenerator<S>
java.lang.Object
   ↳ com.google.gdata.wireformats.output.CharacterGenerator<S>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The CharacterGenerator class is a base class to support the implementation of character-oriented OutputGenerator types. It provides common logic for determining the appropriate character set encoding based upon output properties and will provide a bridge between output streams and writers.

Summary

Public Constructors
CharacterGenerator()
Public Methods
void generate(OutputStream contentStream, OutputProperties outProps, S s)
Generates content to the output stream based upon the provided request/response.
abstract void generate(Writer contentWriter, OutputProperties outProps, S s)
Generates character content to the specified writer.
Protected Methods
static String getCharsetEncoding(OutputProperties outProps)
Returns the character set encoding that should be used for generated output.
Writer getContentWriter(OutputProperties outProps, OutputStream contentStream)
Returns a Writer that is properly configured to generate output based upon the request and response attributes.
boolean usePrettyPrint(OutputProperties outProps)
Returns true if the output should use a pretty printed format on output.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.wireformats.output.OutputGenerator

Public Constructors

public CharacterGenerator ()

Public Methods

public void generate (OutputStream contentStream, OutputProperties outProps, S s)

Generates content to the output stream based upon the provided request/response.

Parameters
contentStream The target stream for content generation.
outProps Output properties for the generated output
s Source object for output generation
Throws
IOException

public abstract void generate (Writer contentWriter, OutputProperties outProps, S s)

Generates character content to the specified writer.

Parameters
contentWriter Output writer.
outProps Output properties for the generated output.
s Source object for the generated output.
Throws
IOException

Protected Methods

protected static String getCharsetEncoding (OutputProperties outProps)

Returns the character set encoding that should be used for generated output.

Parameters
outProps Output properties for generated output
Returns
  • character set encoding for output

protected Writer getContentWriter (OutputProperties outProps, OutputStream contentStream)

Returns a Writer that is properly configured to generate output based upon the request and response attributes.

Parameters
outProps Output properties for the generated output.
contentStream
Returns
  • output writer.
Throws
IOException

protected boolean usePrettyPrint (OutputProperties outProps)

Returns true if the output should use a pretty printed format on output. The default implementation will pretty print output if the PRETTYPRINT parameter has a value of "true".

Parameters
outProps Output properties for the generated output.
Returns
  • true if the output should be formatted.