S
- source object type for output generationpublic abstract class XmlGenerator<S> extends CharacterGenerator<S>
Modifier and Type | Field and Description |
---|---|
protected static java.util.List<ContentType> |
XML_CONTENT_TYPES
The base set of matching content types for XML content.
|
Constructor and Description |
---|
XmlGenerator() |
Modifier and Type | Method and Description |
---|---|
protected static java.util.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.
|
void |
generate(java.io.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 XmlWriter |
getXmlWriter(java.io.Writer w,
OutputProperties outProps,
java.lang.String charset)
Returns an XmlWriter configured based upon request attributes.
|
generate, getCharsetEncoding, getContentWriter, usePrettyPrint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAltFormat, getSourceType
protected static final java.util.List<ContentType> XML_CONTENT_TYPES
protected XmlWriter getXmlWriter(java.io.Writer w, OutputProperties outProps, java.lang.String charset) throws java.io.IOException
w
- The underlying writer to write tooutProps
- output propertiescharset
- 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.)java.io.IOException
- If an error occurs creating the XmlWriter.protected static java.util.List<ContentType> createMatchingXmlList(ContentType... types)
public void generate(java.io.Writer w, OutputProperties outProps, S source) throws java.io.IOException
generate
in class CharacterGenerator<S>
w
- output writer.outProps
- output properties for the generated output.source
- source object for the generated output.java.io.IOException
public abstract void generateXml(XmlWriter w, OutputProperties outProps, S source) throws java.io.IOException
java.io.IOException