org.displaytag.export
Class DefaultItextExportView

java.lang.Object
  extended by org.displaytag.export.DefaultItextExportView
All Implemented Interfaces:
BinaryExportView, ExportView
Direct Known Subclasses:
DefaultPdfExportView, DefaultRtfExportView

public abstract class DefaultItextExportView
extends java.lang.Object
implements BinaryExportView

Exporter using iText: subclasses export to any of the iText document types, such as PDF and RTF.

Version:
$Revision$ ($Author$)
Author:
Jorge L. Barroso

Constructor Summary
DefaultItextExportView()
           
 
Method Summary
 void doExport(java.io.OutputStream out)
          Returns the exported content as a String.
 java.lang.String getMimeType()
          MimeType to return.
protected abstract  void initItextWriter(com.lowagie.text.Document document, java.io.OutputStream out)
          Initializes the iText writer used by export view to write iText document, such as PDF or RTF iText writer.
 void setParameters(TableModel tableModel, boolean exportFullList, boolean includeHeader, boolean decorateValues)
          initialize the parameters needed for export.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultItextExportView

public DefaultItextExportView()
Method Detail

setParameters

public void setParameters(TableModel tableModel,
                          boolean exportFullList,
                          boolean includeHeader,
                          boolean decorateValues)
Description copied from interface: ExportView
initialize the parameters needed for export. The method is guarantee be called before doExport() and getMimeType(). Classes implementing ExportView should reset any instance field previously set when this method is called, in order to support instance reusing.

Specified by:
setParameters in interface ExportView
Parameters:
tableModel - TableModel to render
exportFullList - boolean export full list?
includeHeader - should header be included in export?
decorateValues - should output be decorated?
See Also:
ExportView.setParameters(TableModel, boolean, boolean, boolean)

getMimeType

public java.lang.String getMimeType()
Description copied from interface: ExportView
MimeType to return.

Specified by:
getMimeType in interface ExportView
Returns:
null
See Also:
Meant to be overwritten by subclasses.

doExport

public void doExport(java.io.OutputStream out)
              throws javax.servlet.jsp.JspException
Description copied from interface: BinaryExportView
Returns the exported content as a String.

Specified by:
doExport in interface BinaryExportView
Parameters:
out - output writer
Throws:
javax.servlet.jsp.JspException - for other exceptions during export
See Also:
BinaryExportView.doExport(OutputStream)

initItextWriter

protected abstract void initItextWriter(com.lowagie.text.Document document,
                                        java.io.OutputStream out)
                                 throws com.lowagie.text.DocumentException
Initializes the iText writer used by export view to write iText document, such as PDF or RTF iText writer.

Parameters:
document - The iText document to be written.
out - The output stream to which the document is written.
Throws:
com.lowagie.text.DocumentException - If something goes wrong during initialization.


Copyright © 2002-2007 the Displaytag team. All Rights Reserved.