Class ExcelTableWriter<T>

java.lang.Object
jp.ecuacion.util.poi.excel.table.ExcelTable<T>
jp.ecuacion.util.poi.excel.table.writer.ExcelTableWriter<T>
Type Parameters:
T - See IfExcelTable.
All Implemented Interfaces:
IfExcelTable<T>, IfExcelTableWriter<T>
Direct Known Subclasses:
CellFreeExcelTableWriter, CellOneLineHeaderExcelTableWriter

public abstract class ExcelTableWriter<T> extends ExcelTable<T> implements IfExcelTableWriter<T>
Is a parent of excel table writer classes.
  • Constructor Details

  • Method Details

    • write

      public void write(@RequireNonnull String templateFilePath, @RequireNonnull String destFilePath, @RequireNonnull List<List<T>> data) throws Exception
      Writes table data to the specified excel file.

      data is written to destFilePath, and then workbook is closed.

      Parameters:
      destFilePath - destFilePath
      data - dataList
      Throws:
      Exception
    • write

      public org.apache.poi.ss.usermodel.Workbook write(@RequireNonnull String templateFilePath, @RequireNonnull List<List<T>> data) throws Exception
      Writes table data to the designated excel file.

      data is stored to workbook created from templateFilePath, and the method returns workbook.

      Parameters:
      templateFilePath - templateFilePath
      data - data
      Throws:
      Exception
    • write

      public void write(@RequireNonnull org.apache.poi.ss.usermodel.Workbook workbook, @RequireNonnull List<List<T>> data) throws Exception
      Writes table data to the designated excel file.

      data is stored to workbook.

      Parameters:
      workbook - workbook
      data - dataList
      Throws:
      Exception
    • getIterable

      @Nonnull public ExcelTableWriter.IterableWriter<T> getIterable(@RequireNonnull org.apache.poi.ss.usermodel.Workbook workbook) throws org.apache.poi.EncryptedDocumentException, jp.ecuacion.lib.core.exception.checked.AppException, IOException
      Provides an Iterable writer.
      Parameters:
      workbook - workbook
      Throws:
      org.apache.poi.EncryptedDocumentException
      jp.ecuacion.lib.core.exception.checked.AppException
      IOException
    • headerCheck

      protected abstract void headerCheck(@RequireNonnull org.apache.poi.ss.usermodel.Workbook workbook) throws org.apache.poi.EncryptedDocumentException, jp.ecuacion.lib.core.exception.checked.AppException, IOException
      Obtains header list from the file at templateFilePath.
      Parameters:
      workbook - workbook.
      Throws:
      IOException - IOException
      jp.ecuacion.lib.core.exception.checked.AppException - AppException
      org.apache.poi.EncryptedDocumentException - EncryptedDocumentException
    • ignoresAdditionalColumnsOfHeaderData

      public ExcelTableWriter<T> ignoresAdditionalColumnsOfHeaderData(boolean value)
      Description copied from interface: IfExcelTable
      Stores the boolean value which indicates whether validateHeaderData ignores additional header columns.
      Specified by:
      ignoresAdditionalColumnsOfHeaderData in interface IfExcelTable<T>
      Parameters:
      value - boolean
    • isVerticalAndHorizontalOpposite

      public ExcelTableWriter<T> isVerticalAndHorizontalOpposite(boolean value)
      Description copied from interface: IfExcelTable
      Decides whether header is top (normal table) or left. true means headers are at the left.
      Specified by:
      isVerticalAndHorizontalOpposite in interface IfExcelTable<T>
      Parameters:
      value - boolean
      Returns:
      IfExcelTable<T>