org.pentaho.reporting.engine.classic.core.modules.parser.extwriter
Class ReportWriter

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriterContext
      extended by org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriter

public class ReportWriter
extends ReportWriterContext

A report writer.

Author:
Thomas Morgner

Constructor Summary
ReportWriter(MasterReport reportDefinition, String encoding)
           
ReportWriter(MasterReport report, String encoding, org.pentaho.reporting.libraries.base.config.Configuration config)
          Creates a new report writer for a report.
 
Method Summary
 void addClassFactoryFactory(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.pentaho.reporting.libraries.base.config.Configuration createDefaultConfiguration(MasterReport report)
          Builds a default configuration from a given report definition object.
 ClassFactoryCollector getClassFactoryCollector()
          Returns the class factory collector.
 org.pentaho.reporting.libraries.base.config.Configuration getConfiguration()
          Returns the configuration used to write the report.
 DataSourceCollector getDataSourceCollector()
          Returns the data-source collector.
 ElementFactoryCollector getElementFactoryCollector()
          Returns the element factory collector.
 String getEncoding()
          Returns the encoding.
 StyleKeyFactoryCollector getStyleKeyFactoryCollector()
          Returns the style-key factory collector.
 TemplateCollector getTemplateCollector()
          Returns the template collector.
 void write(Writer w)
          Writes a report to a character stream writer.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriterContext
getReport, hasParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportWriter

public ReportWriter(MasterReport reportDefinition,
                    String encoding)

ReportWriter

public ReportWriter(MasterReport report,
                    String encoding,
                    org.pentaho.reporting.libraries.base.config.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.pentaho.reporting.libraries.base.config.Configuration createDefaultConfiguration(MasterReport report)
Builds a default configuration from a given report definition object.

This will only create a valid definition, if the report has a valid content base object set.

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

getEncoding

public 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.

Overrides:
getDataSourceCollector in class ReportWriterContext
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.

Overrides:
getElementFactoryCollector in class ReportWriterContext
Returns:
The element factory collector.

addClassFactoryFactory

public void addClassFactoryFactory(ClassFactory cf)
Adds a class factory.

Parameters:
cf - the class factory.

getClassFactoryCollector

public ClassFactoryCollector getClassFactoryCollector()
Returns the class factory collector.

Overrides:
getClassFactoryCollector in class ReportWriterContext
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.

Overrides:
getStyleKeyFactoryCollector in class ReportWriterContext
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.

Overrides:
getTemplateCollector in class ReportWriterContext
Returns:
The template collector.

write

public void write(Writer w)
           throws IOException,
                  ReportWriterException
Writes a report to a character stream writer.

Parameters:
w - the character stream writer.
Throws:
IOException - if there is an I/O problem.
ReportWriterException - if there is a problem writing the report.

getConfiguration

public org.pentaho.reporting.libraries.base.config.Configuration getConfiguration()
Returns the configuration used to write the report.

Returns:
the writer configuration.