Package cdc.impex.api
Interface Exporter
-
public interface ExporterInterface implemented by classes that can be used to export data.This 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 voidbeginExport(File file)Must be invoked at beginning of export.voidbeginRow()Must be invoked at beginning of writing a new data row.voidbeginSheet(SheetTemplate template)Must be invoked at the beginning of a sheet export.voidendExport()Must be invoked at end of export.voidendRow()Must be invoked at the end of writing a data row.voidendSheet()Must be invoked at the end of writing a sheet.<T> voidsetData(ColumnTemplate<T> column, T data)Invoked to set the content of a column in current row.voidsetData(String name, Object data)Invoked to set the content of a column in current row.
-
-
-
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) 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.- Throws:
IOException- When a IO error occurs.
-
beginRow
void beginRow() throws IOExceptionMust be invoked at beginning of writing a new data row.- Throws:
IOException- When a IO error occurs.
-
setData
void setData(String name, Object data) throws IOException
Invoked to set the content of a column in current row.- Parameters:
name- The column name.data- The data to write.- Throws:
IOException- When a IO error occurs.
-
setData
<T> void setData(ColumnTemplate<T> column, T data) throws IOException
Invoked to set the content of a column in current row.- Type Parameters:
T- The column data type- Parameters:
column- The column.data- The data to write.- Throws:
IOException- When a IO error occurs.
-
endRow
void endRow() throws IOExceptionMust be invoked at the end of writing a data row.- Throws:
IOException- When a IO error occurs.
-
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.
-
-