com.jrefinery.report.targets.xml
Class XMLProcessor

java.lang.Object
  |
  +--com.jrefinery.report.targets.xml.XMLProcessor

public class XMLProcessor
extends java.lang.Object

The XMLProcessor coordinates the report processing for the XML-Output. This class is responsible to initialize and maintain the XMLWriter, which performs the output process.

The XMLProcessor is not intended to produce complex output, it is an educational example. If you want valid xml data enriched with layouting information, then have a look at the HTML-OutputTarget, this target is also able to write XHTMl code.

Author:
Thomas Morgner

Constructor Summary
XMLProcessor(JFreeReport report)
          Creates a new XMLProcessor.
 
Method Summary
protected  JFreeReport getReport()
          Returns the XMLProcessors local report instance.
 java.io.Writer getWriter()
          Returns the writer, which will receive the generated output.
 void processReport()
          Processes the report.
 void setWriter(java.io.Writer writer)
          Sets the writer, which will receive the generated output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLProcessor

public XMLProcessor(JFreeReport report)
             throws ReportProcessingException,
                    FunctionInitializeException
Creates a new XMLProcessor. The processor will output the report as simple xml stream.

Parameters:
report - the report that should be processed
Throws:
ReportProcessingException - if the report could not be initialized
FunctionInitializeException - if the writer function could not be initialized.
Method Detail

getReport

protected JFreeReport getReport()
Returns the XMLProcessors local report instance. This instance has the XMLWriter attached and should be used outside of this class.

Returns:
the processors report instance.

getWriter

public java.io.Writer getWriter()
Returns the writer, which will receive the generated output.

Returns:
the writer

setWriter

public void setWriter(java.io.Writer writer)
Sets the writer, which will receive the generated output. The writer should have the proper encoding set.

Parameters:
writer - that should receive the generated output.

processReport

public void processReport()
                   throws ReportProcessingException
Processes the report. The generated output is written using the defined writer, the report is repaginated before the final writing.

Throws:
ReportProcessingException - if the report processing failed.
java.lang.IllegalStateException - if there is no writer defined.