public abstract class

XmlGenerator

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

Class Overview

The XmlGenerator class is an abstract base class supporting the implementation of the OutputGenerator interface for XML content types.

Summary

Fields
protected static final List<ContentType> XML_CONTENT_TYPES The base set of matching content types for XML content.
Public Constructors
XmlGenerator()
Public Methods
void generate(Writer w, OutputProperties outProps, S source)
Generates content to the writer based upon the provided request/response.
abstract void generateXml(XmlWriter w, OutputProperties outProps, S source)
Generates the XML content to the provided XML writer instance based upon the query request/response attributes.
Protected Methods
static List<ContentType> createMatchingXmlList(ContentType... types)
Creates a new matching ContentType set that contains all of the basic XML types plus an additional list of types.
XmlWriter getXmlWriter(Writer w, OutputProperties outProps, String charset)
Returns an XmlWriter configured based upon request attributes.
[Expand]
Inherited Methods
From class com.google.gdata.wireformats.output.CharacterGenerator
From class java.lang.Object
From interface com.google.gdata.wireformats.output.OutputGenerator

Fields

protected static final List<ContentType> XML_CONTENT_TYPES

The base set of matching content types for XML content. Custom subclasses may add to this list.

Public Constructors

public XmlGenerator ()

Public Methods

public void generate (Writer w, OutputProperties outProps, S source)

Generates content to the writer based upon the provided request/response.

Parameters
w Output writer.
outProps Output properties for the generated output.
source Source object for the generated output.
Throws
IOException

public abstract void generateXml (XmlWriter w, OutputProperties outProps, S source)

Generates the XML content to the provided XML writer instance based upon the query request/response attributes.

Parameters
w
outProps
source
Throws
IOException

Protected Methods

protected static List<ContentType> createMatchingXmlList (ContentType... types)

Creates a new matching ContentType set that contains all of the basic XML types plus an additional list of types.

Parameters
types

protected XmlWriter getXmlWriter (Writer w, OutputProperties outProps, String charset)

Returns an XmlWriter configured based upon request attributes.

Parameters
w The underlying writer to write to
outProps Output properties
charset The writer's character encoding (determines which characters need to be escaped. Note that the writer must already be configured to use this character set. If the writer and the character set are out of sync, the generated XML may be overly escaped (not too bad) or malformed (pretty serious.)
Returns
  • An XmlWriter
Throws
IOException If an error occurs creating the XmlWriter.