Interface ExcelAdapter<T,U extends org.apache.poi.ss.usermodel.Workbook>
- All Known Implementing Classes:
DatasetExcelAdapter
,RMExcelWriterXlsx
public interface ExcelAdapter<T,U extends org.apache.poi.ss.usermodel.Workbook>
An adapter interface that supports drawing
Workbook
s and Sheet
s based on the supplied objects.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The known types that can be directly set via Apache POI for a cell. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Draws aSheet
for the specificExcelAdapter
default U
drawWorkbook
(boolean headerRow, boolean nullsEmpty, T[] object) Draws the supplied object(s)ExcelAdapter
and returnsExcelAdapter
drawWorkbook
(boolean headerRow, boolean nullsEmpty, T[] object, String[] sheetNames) Draws the supplied object(s)ExcelAdapter
and returnsExcelAdapter
-
Method Details
-
drawWorkbook
Draws the supplied object(s)ExcelAdapter
and returnsExcelAdapter
- Parameters:
headerRow
- iftrue
, header rows are expected to be written, otherwise false. It is up to the implementation whether this is respected or not.nullsEmpty
- iftrue
, null values will not be written to cells in the excel document. It is up to the implementation whether this is respected or not.object
- The object(s) that the Adapter is compatible with for writing.- Returns:
- A
Workbook
of typeU
that can be closed or further manipulated.
-
drawWorkbook
Draws the supplied object(s)ExcelAdapter
and returnsExcelAdapter
- Parameters:
headerRow
- iftrue
, header rows are expected to be written, otherwise false. It is up to the implementation whether this is respected or not.nullsEmpty
- iftrue
, null values will not be written to cells in the excel document. It is up to the implementation whether this is respected or not.object
- The object(s) that the Adapter is compatible with for writing.sheetNames
- The names of the sheets to create. If null, will use a generic default.- Returns:
- A
Workbook
of typeU
that can be closed or further manipulated.
-
drawSheet
Draws aSheet
for the specificExcelAdapter
- Parameters:
workbook
- the Workbook to add the new sheet tosheetName
- the name of the sheet. This name should be checked viaWorkbookUtil.createSafeSheetName(String)
object
- the object to write to the sheetheaderRow
- iftrue
, header rows are expected to be written, otherwise false. It is up to the implementation whether this is respected or not.nullsEmpty
- iftrue
, null values will not be written to cells in the excel document. It is up to the implementation whether this is respected or not.- Returns:
true
if the object was successfully written to the workbook as a new sheet,false
if the object was not written successfully.
-