Class CellOneLineHeaderExcelTableWriter

java.lang.Object
jp.ecuacion.util.poi.excel.table.ExcelTable<org.apache.poi.ss.usermodel.Cell>
jp.ecuacion.util.poi.excel.table.writer.ExcelTableWriter<org.apache.poi.ss.usermodel.Cell>
jp.ecuacion.util.poi.excel.table.writer.concrete.CellOneLineHeaderExcelTableWriter
All Implemented Interfaces:
IfDataTypeCellExcelTable, IfExcelTable<org.apache.poi.ss.usermodel.Cell>, IfFormatOneLineHeaderExcelTable<org.apache.poi.ss.usermodel.Cell>, IfDataTypeCellExcelTableWriter, IfExcelTableWriter<org.apache.poi.ss.usermodel.Cell>

public class CellOneLineHeaderExcelTableWriter extends ExcelTableWriter<org.apache.poi.ss.usermodel.Cell> implements IfDataTypeCellExcelTableWriter, IfFormatOneLineHeaderExcelTable<org.apache.poi.ss.usermodel.Cell>
Reads tables with known number of columns, one line header labels if it has a header line.
  • Constructor Details

    • CellOneLineHeaderExcelTableWriter

      public CellOneLineHeaderExcelTableWriter(@RequireNonnull String sheetName, @RequireNonnull String[] headerLabels, @Nullable Integer tableStartRowNumber, int tableStartColumnNumber)
      Constructs a new instance.
      Parameters:
      sheetName - See ExcelTable.sheetName.
      tableStartRowNumber - See ExcelTable.tableStartRowNumber. The row number must specify the header row of the table Since the writer does not overwrite the header, but the writer does read and validate it.
      tableStartColumnNumber - See ExcelTable.tableStartColumnNumber.
  • Method Details

    • getHeaderLabels

      @Nonnull public String[] getHeaderLabels()
      Description copied from interface: IfFormatOneLineHeaderExcelTable
      Defines the header labels in the excel table.

      It can be like new String[] {"first name", "last name", "age"}.

      Specified by:
      getHeaderLabels in interface IfFormatOneLineHeaderExcelTable<org.apache.poi.ss.usermodel.Cell>
    • headerCheck

      protected void headerCheck(@RequireNonnull org.apache.poi.ss.usermodel.Workbook workbook) throws org.apache.poi.EncryptedDocumentException, jp.ecuacion.lib.core.exception.checked.AppException, IOException
      Description copied from class: ExcelTableWriter
      Obtains header list from the file at templateFilePath.
      Specified by:
      headerCheck in class ExcelTableWriter<org.apache.poi.ss.usermodel.Cell>
      Parameters:
      workbook - workbook.
      Throws:
      org.apache.poi.EncryptedDocumentException - EncryptedDocumentException
      jp.ecuacion.lib.core.exception.checked.AppException - AppException
      IOException - IOException
    • getColumnStyleMap

      public Map<Integer,org.apache.poi.ss.usermodel.CellStyle> getColumnStyleMap()
      Description copied from interface: IfDataTypeCellExcelTableWriter
      Gets columnStyleMap to reuse CellStyle.
      Specified by:
      getColumnStyleMap in interface IfDataTypeCellExcelTableWriter
      Returns:
      columnStyleMap
    • copiesDataFormatOnly

      public CellOneLineHeaderExcelTableWriter copiesDataFormatOnly(boolean copiesDataFormatOnly)
      Description copied from interface: IfDataTypeCellExcelTableWriter
      Sets copiesDataFormatOnly value.

      When this is true, whole style is not copied to the destination cell, but DataFormat only.
      This means grid-line, font, font-size, cell color, etc... of the cell is not copied.

      Specified by:
      copiesDataFormatOnly in interface IfDataTypeCellExcelTableWriter
      Parameters:
      copiesDataFormatOnly - boolean
    • copiesDataFormatOnly

      public boolean copiesDataFormatOnly()
      Description copied from interface: IfDataTypeCellExcelTableWriter
      Returns copiesDataFormatOnly value.

      When this is true, whole style is not copied to the destination cell, but DataFormat only.
      This means grid-line, font, font-size, cell color, etc... of the cell is not copied.

      Specified by:
      copiesDataFormatOnly in interface IfDataTypeCellExcelTableWriter
      Returns:
      boolean