org.jfree.report.modules.parser.extwriter
Class ReportWriter

java.lang.Object
  |
  +--org.jfree.report.modules.parser.extwriter.ReportWriter

public class ReportWriter
extends java.lang.Object

A report writer.

Author:
Thomas Morgner

Constructor Summary
ReportWriter(JFreeReport report, java.lang.String encoding, org.jfree.util.Configuration config)
          Creates a new report writer for a report.
 
Method Summary
 void addClassFactoryFactory(org.jfree.xml.factory.objects.ClassFactory cf)
          Adds a class factory.
 void addDataSourceFactory(DataSourceFactory dsf)
          Adds a data-source factory.
 void addElementFactory(ElementFactory ef)
          Adds an element factory.
 void addStyleKeyFactory(StyleKeyFactory skf)
          Adds a style-key factory.
 void addTemplateCollection(TemplateCollection collection)
          Adds a template collection.
static org.jfree.util.Configuration createDefaultConfiguration(JFreeReport report)
          Builds a default configuration from a given report definition object.
 org.jfree.xml.factory.objects.ClassFactoryCollector getClassFactoryCollector()
          Returns the class factory collector.
 org.jfree.util.Configuration getConfiguration()
          Returns the configuration used to write the report.
 DataSourceCollector getDataSourceCollector()
          Returns the data-source collector.
 ElementFactoryCollector getElementFactoryCollector()
          Returns the element factory collector.
 java.lang.String getEncoding()
          Returns the encoding.
 JFreeReport getReport()
          Returns the report.
 StyleKeyFactoryCollector getStyleKeyFactoryCollector()
          Returns the style-key factory collector.
 TemplateCollector getTemplateCollector()
          Returns the template collector.
 void write(java.io.Writer w)
          Writes a report to a character stream writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportWriter

public ReportWriter(JFreeReport report,
                    java.lang.String encoding,
                    org.jfree.util.Configuration config)
Creates a new report writer for a report.
Parameters:
report - the report.
encoding - the encoding.
config - the write configuration.
Method Detail

createDefaultConfiguration

public static org.jfree.util.Configuration createDefaultConfiguration(JFreeReport report)
Builds a default configuration from a given report definition object.

This will only create a valid definition, if the report properties were filled by the parser and contain the key report.definition.contentbase.

Parameters:
report - the report for which to create the writer configuration.
Returns:
the generated configuration.

getEncoding

public java.lang.String getEncoding()
Returns the encoding.
Returns:
The encoding.

addDataSourceFactory

public void addDataSourceFactory(DataSourceFactory dsf)
Adds a data-source factory.
Parameters:
dsf - the data-source factory.

getDataSourceCollector

public DataSourceCollector getDataSourceCollector()
Returns the data-source collector.
Returns:
The data-source collector.

addElementFactory

public void addElementFactory(ElementFactory ef)
Adds an element factory.
Parameters:
ef - the element factory.

getElementFactoryCollector

public ElementFactoryCollector getElementFactoryCollector()
Returns the element factory collector.
Returns:
The element factory collector.

addClassFactoryFactory

public void addClassFactoryFactory(org.jfree.xml.factory.objects.ClassFactory cf)
Adds a class factory.
Parameters:
cf - the class factory.

getClassFactoryCollector

public org.jfree.xml.factory.objects.ClassFactoryCollector getClassFactoryCollector()
Returns the class factory collector.
Returns:
The class factory collector.

addStyleKeyFactory

public void addStyleKeyFactory(StyleKeyFactory skf)
Adds a style-key factory.
Parameters:
skf - the style-key factory.

getStyleKeyFactoryCollector

public StyleKeyFactoryCollector getStyleKeyFactoryCollector()
Returns the style-key factory collector.
Returns:
The style-key factory collector.

addTemplateCollection

public void addTemplateCollection(TemplateCollection collection)
Adds a template collection.
Parameters:
collection - the template collection.

getTemplateCollector

public TemplateCollector getTemplateCollector()
Returns the template collector.
Returns:
The template collector.

getReport

public JFreeReport getReport()
Returns the report.
Returns:
The report.

write

public void write(java.io.Writer w)
           throws java.io.IOException,
                  ReportWriterException
Writes a report to a character stream writer.
Parameters:
w - the character stream writer.
Throws:
java.io.IOException - if there is an I/O problem.
ReportWriterException - if there is a problem writing the report.

getConfiguration

public org.jfree.util.Configuration getConfiguration()
Returns the configuration used to write the report.
Returns:
the writer configuration.