Class CellFreeExcelTableWriter

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.CellFreeExcelTableWriter
All Implemented Interfaces:
IfDataTypeCellExcelTable, IfExcelTable<org.apache.poi.ss.usermodel.Cell>, IfFormatFreeExcelTable<org.apache.poi.ss.usermodel.Cell>, IfDataTypeCellExcelTableWriter, IfExcelTableWriter<org.apache.poi.ss.usermodel.Cell>

public class CellFreeExcelTableWriter extends ExcelTableWriter<org.apache.poi.ss.usermodel.Cell> implements IfFormatFreeExcelTable<org.apache.poi.ss.usermodel.Cell>, IfDataTypeCellExcelTableWriter
Reads tables with unknown number of columns, unknown whether it have a header line, unknown header labels if it has a header line.

It obtains cell values as Cell object.

The header line is not necessary. This class reads the table at the designated position and designated lines and columns.
Finish reading if all the columns are empty in one line.

  • Constructor Details

  • Method Details

    • getStringValue

      public String getStringValue(@Nullable org.apache.poi.ss.usermodel.Cell cellData) throws jp.ecuacion.util.poi.excel.exception.ExcelAppException
      Description copied from interface: IfExcelTable
      Is used to get the header label string from the argument cell data.
      Specified by:
      getStringValue in interface IfDataTypeCellExcelTable
      Specified by:
      getStringValue in interface IfExcelTable<org.apache.poi.ss.usermodel.Cell>
      Parameters:
      cellData - data obtained from the cell
      Returns:
      String value obtained from the cellData
      Throws:
      jp.ecuacion.util.poi.excel.exception.ExcelAppException - ExcelAppException
    • 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 CellFreeExcelTableWriter 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