Style Intelligence v12.0

inetsoft.report.io
Class BaseFormatter

java.lang.Object
  extended by inetsoft.report.io.BaseFormatter
All Implemented Interfaces:
Formatter
Direct Known Subclasses:
DelimitedFormatter, HTMLFormatter, RTFFormatter, TemplateFormatter

public abstract class BaseFormatter
extends Object
implements Formatter

This is the base class of all formatter classes. It contains common methods of formatter classes.


Field Summary
protected  DocumentInfo docInfo
           
protected  ReportSheet report
           
 
Constructor Summary
BaseFormatter()
           
 
Method Summary
 void addProgressListener(ProgressListener listener)
          Add a listener to be notified of export progress.
abstract  void end()
          Write end.
protected abstract  void endCell()
          End a cell.
protected abstract  void endGrid()
          End the layout grid.
protected abstract  void endRow()
          End a row.
static String escape(String str)
          Escape a string with XML escape string for attribute values.
protected  void fireProgressEvent(int current)
          Fire a progress event.
protected  void init(ReportSheet report)
          Initialize the report.
protected  void localize(ReportSheet sheet)
          Localize the report.
 void removeProgressListener(ProgressListener listener)
          Remove a listener.
 void setDocumentInfo(DocumentInfo info)
          Set the document info to export.
protected abstract  void startCell(TabularSheet sheet, int r, int c, Object bg, Insets borders, Color bcolor, Rectangle span, String width, boolean repeat)
          Start a new cell.
protected abstract  void startGrid(int rows, int cols)
          Start a layout grid (for tabular layout).
protected abstract  void startRow(TabularSheet sheet, int row)
          Start a new row.
 void write(ParameterElement elem)
          Write a parameter element.
 void write(ReportElement elem)
          Write one element.
 void write(ReportSheet sheet)
          Export a report.
protected  void write(SubreportElement subreport)
          Write a subreport.
protected  void writeBeanPropertyDefinition(String prop, BeanPropertyDefinition map)
          Write a bean mapping definition.
protected  void writeContents(BeanSheet sheet)
          Export a BeanSheet object.
protected  void writeContents(StyleSheet sheet)
          Export a StyleSheet report.
protected  void writeContents(TabularSheet sheet)
          Export a TabularSheet report.
protected  void writeElementContents(ReportElement elem, ReportSheet sheet)
          Export a element content object.
protected  void writeSection(inetsoft.report.internal.SectionElementDef elem)
          Write section.
protected abstract  void writeSectionBand(SectionBand band)
          Print one band.
protected abstract  void writeShapes(PageLayout.Shape[] shapes)
          Write the pagelayout shapes specifications.
protected  void writeWarnings(ReportElement elem, ReportSheet sheet)
          Write warning informations.
protected  void writeWarnings(String[] warnings)
          Write warning messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.report.io.Formatter
endHeader, prolog, startHeader, startHeader, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write
 

Field Detail

docInfo

protected DocumentInfo docInfo

report

protected ReportSheet report
Constructor Detail

BaseFormatter

public BaseFormatter()
Method Detail

setDocumentInfo

public void setDocumentInfo(DocumentInfo info)
Set the document info to export.

Specified by:
setDocumentInfo in interface Formatter

addProgressListener

public void addProgressListener(ProgressListener listener)
Add a listener to be notified of export progress.

Specified by:
addProgressListener in interface Formatter

removeProgressListener

public void removeProgressListener(ProgressListener listener)
Remove a listener.

Specified by:
removeProgressListener in interface Formatter

fireProgressEvent

protected void fireProgressEvent(int current)
Fire a progress event.


writeContents

protected void writeContents(StyleSheet sheet)
                      throws IOException
Export a StyleSheet report.

Throws:
IOException

writeContents

protected void writeContents(BeanSheet sheet)
                      throws IOException
Export a BeanSheet object.

Throws:
IOException

writeElementContents

protected void writeElementContents(ReportElement elem,
                                    ReportSheet sheet)
                             throws IOException
Export a element content object.

Throws:
IOException

writeContents

protected void writeContents(TabularSheet sheet)
                      throws IOException
Export a TabularSheet report.

Throws:
IOException

writeWarnings

protected void writeWarnings(ReportElement elem,
                             ReportSheet sheet)
Write warning informations.


startGrid

protected abstract void startGrid(int rows,
                                  int cols)
Start a layout grid (for tabular layout).

Parameters:
rows - number of rows.
cols - number of columns.

endGrid

protected abstract void endGrid()
End the layout grid.


startRow

protected abstract void startRow(TabularSheet sheet,
                                 int row)
Start a new row.

Parameters:
sheet - tabular report object.
row - row index in the grid.

endRow

protected abstract void endRow()
End a row.


startCell

protected abstract void startCell(TabularSheet sheet,
                                  int r,
                                  int c,
                                  Object bg,
                                  Insets borders,
                                  Color bcolor,
                                  Rectangle span,
                                  String width,
                                  boolean repeat)
Start a new cell.

Parameters:
r - row index.
c - column index.
bg - cell background color or image.
borders - border setting.
bcolor - border color.
span - cell span.
width - column width. See TabularSheet for width specification format.
repeat - true to repeat the cell contents on every page.

endCell

protected abstract void endCell()
End a cell.


init

protected void init(ReportSheet report)
Initialize the report.


write

public void write(ReportSheet sheet)
           throws IOException
Export a report.

Specified by:
write in interface Formatter
Parameters:
sheet - report to export.
Throws:
IOException

localize

protected void localize(ReportSheet sheet)
Localize the report.


write

public void write(ReportElement elem)
           throws IOException
Write one element.

Parameters:
elem - report element.
Throws:
IOException

writeWarnings

protected void writeWarnings(String[] warnings)
                      throws IOException
Write warning messages.

Throws:
IOException

write

public void write(ParameterElement elem)
           throws IOException
Write a parameter element.

Specified by:
write in interface Formatter
Throws:
IOException

writeSection

protected void writeSection(inetsoft.report.internal.SectionElementDef elem)
                     throws IOException
Write section. The derived class must implements the writeSectionBand() method.

Throws:
IOException

write

protected void write(SubreportElement subreport)
              throws IOException
Write a subreport.

Throws:
IOException

writeSectionBand

protected abstract void writeSectionBand(SectionBand band)
                                  throws IOException
Print one band.

Throws:
IOException

writeShapes

protected abstract void writeShapes(PageLayout.Shape[] shapes)
Write the pagelayout shapes specifications.


end

public abstract void end()
                  throws IOException
Write end.

Specified by:
end in interface Formatter
Throws:
IOException

writeBeanPropertyDefinition

protected void writeBeanPropertyDefinition(String prop,
                                           BeanPropertyDefinition map)
Write a bean mapping definition.


escape

public static String escape(String str)
Escape a string with XML escape string for attribute values.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.