Class DatasetExcelAdapter

  • All Implemented Interfaces:
    ExcelAdapter<Dataset,​org.apache.poi.xssf.usermodel.XSSFWorkbook>

    public class DatasetExcelAdapter
    extends java.lang.Object
    implements ExcelAdapter<Dataset,​org.apache.poi.xssf.usermodel.XSSFWorkbook>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean drawSheet​(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, java.lang.String sheetName, Dataset dataset, boolean headerRow, boolean nullsEmpty)
      Draws a Sheet for the specific ExcelAdapter
      org.apache.poi.xssf.usermodel.XSSFWorkbook drawWorkbook​(boolean headerRow, boolean nullsEmpty, Dataset... datasets)
      Draws the supplied object(s) ExcelAdapter and returns ExcelAdapter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatasetExcelAdapter

        public DatasetExcelAdapter()
    • Method Detail

      • drawWorkbook

        public org.apache.poi.xssf.usermodel.XSSFWorkbook drawWorkbook​(boolean headerRow,
                                                                       boolean nullsEmpty,
                                                                       Dataset... datasets)
        Description copied from interface: ExcelAdapter
        Draws the supplied object(s) ExcelAdapter and returns ExcelAdapter
        Specified by:
        drawWorkbook in interface ExcelAdapter<Dataset,​org.apache.poi.xssf.usermodel.XSSFWorkbook>
        Parameters:
        headerRow - if true, header rows are expected to be written, otherwise false. It is up to the implementation whether this is respected or not.
        nullsEmpty - if true, null values will not be written to cells in the excel document. It is up to the implementation whether this is respected or not.
        datasets - The object(s) that the Adapter is compatible with for writing.
        Returns:
        A Workbook of type U that can be closed or further manipulated.
      • drawSheet

        public boolean drawSheet​(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook,
                                 java.lang.String sheetName,
                                 Dataset dataset,
                                 boolean headerRow,
                                 boolean nullsEmpty)
        Description copied from interface: ExcelAdapter
        Draws a Sheet for the specific ExcelAdapter
        Specified by:
        drawSheet in interface ExcelAdapter<Dataset,​org.apache.poi.xssf.usermodel.XSSFWorkbook>
        Parameters:
        workbook - the Workbook to add the new sheet to
        sheetName - the name of the sheet. This name should be checked via WorkbookUtil.createSafeSheetName(String)
        dataset - the object to write to the sheet
        headerRow - if true, header rows are expected to be written, otherwise false. It is up to the implementation whether this is respected or not.
        nullsEmpty - if true, 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.