Package cdc.impex.api.exports
Interface ExportDriver
-
public interface ExportDriverInterface implemented by classes that can be used to export data.This is a low level API that should be used like this:
beginExport(file); foreach (sheet): beginSheet(sheet.template); foreach (row): beginRow(); foreach(column): setData(column, data); endRow(); endSheet(); endExport();- Author:
- Damien Carbonne
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddRow(ExportRow row)voidbeginExport(File file)Must be invoked at beginning of export.voidbeginSheet(SheetTemplate template, String sheetName, long numberOfRows)Must be invoked at the beginning of a sheet export.voidendExport()Must be invoked at end of export.voidendSheet()Must be invoked at the end of writing a sheet.
-
-
-
Method Detail
-
beginExport
void beginExport(File file) throws IOException
Must be invoked at beginning of export.- Parameters:
file- The target file.- Throws:
IOException- When a IO error occurs.
-
beginSheet
void beginSheet(SheetTemplate template, String sheetName, long numberOfRows) throws IOException
Must be invoked at the beginning of a sheet export.Using several times the same template in a workbook must be supported.
- Parameters:
template- The template used for that sheet.sheetName- The sheet name.numberOfRows- The number of rows to export in this sheet, or -1L if unknown.- Throws:
IOException- When a IO error occurs.
-
addRow
void addRow(ExportRow row) throws IOException
- Throws:
IOException
-
endSheet
void endSheet() throws IOExceptionMust be invoked at the end of writing a sheet.- Throws:
IOException- When a IO error occurs.
-
endExport
void endExport() throws IOExceptionMust be invoked at end of export.- Throws:
IOException- When a IO error occurs.
-
-