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

java.lang.Object
  |
  +--com.jrefinery.report.targets.table.TableProducer
        |
        +--com.jrefinery.report.targets.table.html.HtmlProducer

public class HtmlProducer
extends TableProducer

The TableProducer is responsible for creating the produced Table. After the writer has finished the band layout process, the layouted bands are forwarded into the TableProducer. The TableProducer coordinates the cell creation process and collects the generated TableCellData. The raw CellData objects are later transformed into a TableGridLayout.

The generated HTML code is cached and written after the last cell was created, to insert the StyleSheet into the html header.

Author:
Thomas Morgner

Field Summary
static java.lang.String ENCODING
          the fileencoding for the main html file.
static java.lang.String ENCODING_DEFAULT
          a default value for the fileencoding of the main html file.
 
Fields inherited from class com.jrefinery.report.targets.table.TableProducer
AUTHOR, CREATOR, TITLE
 
Constructor Summary
HtmlProducer(HtmlFilesystem filesystem, boolean strict, boolean useXHTML)
          Creates a new HTMLProducer.
 
Method Summary
 void beginPage(java.lang.String name)
          Start a new page, start a new table.
 void close()
          Closes the target and writes all generated content into the root stream of the filesystem after generating the StyleSheet information.
 void configure(java.util.Properties configuration)
          Configures the table producer by reading the configuration settings from the given map.
protected  java.lang.String createHtmlBackgroundStyle(java.util.List background)
          Merges the backgrounds and creates the StyleSheet information for the cell background.
 void endPage()
          End the page and generate the table for the page.
 TableCellDataFactory getCellDataFactory()
          Gets the TableProducer implementation of this TableProducer.
 java.lang.String getEncoding()
          Gets the defined file encoding for the main html file.
static CharacterEntityParser getEntityParser()
          Gets the character entity parser for HTML content.
 boolean isOpen()
          Returns true, if the TableProducer is open.
 void open()
          Starts the report writing and prepares the cached output stream.
 
Methods inherited from class com.jrefinery.report.targets.table.TableProducer
addCell, clearCells, createTableCellStyle, getCellCount, getProperty, getProperty, getPropertyNames, isDummy, layoutGrid, processBand, setDummy, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final java.lang.String ENCODING
the fileencoding for the main html file.

See Also:
Constant Field Values

ENCODING_DEFAULT

public static final java.lang.String ENCODING_DEFAULT
a default value for the fileencoding of the main html file.

See Also:
Constant Field Values
Constructor Detail

HtmlProducer

public HtmlProducer(HtmlFilesystem filesystem,
                    boolean strict,
                    boolean useXHTML)
Creates a new HTMLProducer.

Parameters:
filesystem - the filesystem used to store the generated content.
strict - a flag whether to use the strict layout mode.
useXHTML - a flag whether to generate XHTML content.
Method Detail

getEncoding

public java.lang.String getEncoding()
Gets the defined file encoding for the main html file.

Returns:
the encoding.

getEntityParser

public static CharacterEntityParser getEntityParser()
Gets the character entity parser for HTML content. The CharacterEntity parser translates known characters into predefined entities.

Returns:
the character entity parser instance.

open

public void open()
Starts the report writing and prepares the cached output stream.

Specified by:
open in class TableProducer

close

public void close()
Closes the target and writes all generated content into the root stream of the filesystem after generating the StyleSheet information.

Specified by:
close in class TableProducer

endPage

public void endPage()
End the page and generate the table for the page.

Specified by:
endPage in class TableProducer

beginPage

public void beginPage(java.lang.String name)
Start a new page, start a new table.

Specified by:
beginPage in class TableProducer
Parameters:
name - the page name

getCellDataFactory

public TableCellDataFactory getCellDataFactory()
Gets the TableProducer implementation of this TableProducer.

Specified by:
getCellDataFactory in class TableProducer
Returns:
the TableProducers TableCellDataFactory, which is used to create the TableCellData.

isOpen

public boolean isOpen()
Returns true, if the TableProducer is open. Only open producers are able to write TableCells or to create TableCellData from Elements.

Specified by:
isOpen in class TableProducer
Returns:
checks, whether the TableProducer is open.

createHtmlBackgroundStyle

protected java.lang.String createHtmlBackgroundStyle(java.util.List background)
Merges the backgrounds and creates the StyleSheet information for the cell background.

Parameters:
background - the (unmerged) background styles.
Returns:
the background style sheet definition.

configure

public void configure(java.util.Properties configuration)
Configures the table producer by reading the configuration settings from the given map.

Specified by:
configure in class TableProducer
Parameters:
configuration - the configuration supplied by the table processor.