com.jrefinery.report.targets.table.html
Class HtmlProcessor

java.lang.Object
  extended bycom.jrefinery.report.targets.table.TableProcessor
      extended bycom.jrefinery.report.targets.table.html.HtmlProcessor

public class HtmlProcessor
extends TableProcessor

The HtmlProcessor handles the initialisation of the report writer and starts and manages the report process.

The Html content is not written directly into an OutputStream. As Html-Files are able to use external references to include images and style information, the output target is provided using an abstract HtmlFilesystem.

Depending on the implementation, the output is written into a directory, a ZipFile or a single Html-stream.

This output target supports the generation of XHTML or HTML4 output. All recent browsers should be able to handle XHTML output. XHTML is standard XML code, so that any XML parser is able to read and parse the generated output.

If not specified otherwise, this Processor uses the System Encoding as output enconding, or UTF-8 if no system encoding is defined. When generating XHTML output, make sure that your parser supports your selected encoding, all JAXP compatible parsers must support at least UTF-8 and US-ASCII encoding.

Author:
Thomas Morgner
See Also:
HtmlFilesystem

Constructor Summary
HtmlProcessor(JFreeReport report)
          Creates a new HtmlProcessor, which generates HTML4 output and uses the standard file encoding.
HtmlProcessor(JFreeReport report, boolean useXHTML)
          Creates a new HtmlProcessor, which uses the standard file encoding.
 
Method Summary
 TableProducer createProducer(boolean dummy)
          Creates a HTMLProducer.
 HtmlFilesystem getFilesystem()
          Gets the HTMLFilesystem, which should be used, or null, if no filesystem is defined yet.
protected  java.lang.String getReportConfigurationPrefix()
          Gets the report configuration prefix for that processor.
 boolean isGenerateXHTML()
          Gets the XHTML flag.
 void setFilesystem(HtmlFilesystem filesystem)
          Defines the HTMLFileSystem, that should be used to store the content.
 void setGenerateXHTML(boolean useXHTML)
          Defines the XHTML flag.
 
Methods inherited from class com.jrefinery.report.targets.table.TableProcessor
configure, getProperties, getProperty, getProperty, getPropertyNames, getReport, isStrictLayout, processReport, setProperty, setStrictLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlProcessor

public HtmlProcessor(JFreeReport report)
              throws ReportProcessingException,
                     FunctionInitializeException
Creates a new HtmlProcessor, which generates HTML4 output and uses the standard file encoding.

Parameters:
report - the report that should be processed.
Throws:
ReportProcessingException - if the report initialization failed
FunctionInitializeException - if the table writer initialization failed.

HtmlProcessor

public HtmlProcessor(JFreeReport report,
                     boolean useXHTML)
              throws ReportProcessingException,
                     FunctionInitializeException
Creates a new HtmlProcessor, which uses the standard file encoding.

Parameters:
report - the report that should be processed.
useXHTML - true, if XML output should be generated, false for HTML4 compatible output.
Throws:
ReportProcessingException - if the report initialization failed
FunctionInitializeException - if the table writer initialization failed.
Method Detail

isGenerateXHTML

public boolean isGenerateXHTML()
Gets the XHTML flag.

Returns:
true, if XHTML output is generated, false otherwise.

setGenerateXHTML

public void setGenerateXHTML(boolean useXHTML)
Defines the XHTML flag. Set to true, to generate XHTML output, false for HTML4 compatible code.

Parameters:
useXHTML - the XHTML flag.

getFilesystem

public HtmlFilesystem getFilesystem()
Gets the HTMLFilesystem, which should be used, or null, if no filesystem is defined yet.

Returns:
the filesystem, which should be used to store the created content.

setFilesystem

public void setFilesystem(HtmlFilesystem filesystem)
Defines the HTMLFileSystem, that should be used to store the content.

Parameters:
filesystem - the filesystem for storing the generated content.

createProducer

public TableProducer createProducer(boolean dummy)
Creates a HTMLProducer. The HTMLProducer is responsible to create the table.

Specified by:
createProducer in class TableProcessor
Parameters:
dummy - true, if dummy mode is enabled, and no writing should be done, false otherwise.
Returns:
the created table producer, never null.

getReportConfigurationPrefix

protected java.lang.String getReportConfigurationPrefix()
Gets the report configuration prefix for that processor. This prefix defines how to map the property names into the global report configuration.

Specified by:
getReportConfigurationPrefix in class TableProcessor
Returns:
the report configuration prefix.