Class ExcelTable<T>

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

public abstract class ExcelTable<T> extends Object implements IfExcelTable<T>
Stores properties in an excel table.
  • Field Details

    • sheetName

      @NotNull @Nonnull protected @NotNull String sheetName
      Is the sheet name of the excel file.
    • tableStartRowNumber

      @Nullable @Min(1L) protected @Min(1L) Integer tableStartRowNumber
      Is the row number from which the table starts.

      The minimum value is 1, which means the table starts at the first line of the excel sheet.

      0 or the number smaller than that is not acceptable.
      null is acceptable, which means tableStartRowNumber is decided by the far left header value of the table.

      The header value is obtained from IfExcelTable.getFarLeftAndTopHeaderLabel().

    • tableStartColumnNumber

      @Min(1L) protected @jakarta.validation.constraints.Min(1L) int tableStartColumnNumber
      Is the column number from which the table starts.

      The minimum value is 1, which means the table starts at the far left column of the excel sheet.

      0 or the number smaller than that is not acceptable.
      null is not acceptable.
      (Its data type is primitive int, so it can't have null anyway.)

    • ignoresAdditionalColumnsOfHeaderData

      protected boolean ignoresAdditionalColumnsOfHeaderData
    • isVerticalAndHorizontalOpposite

      protected boolean isVerticalAndHorizontalOpposite
  • Constructor Details

    • ExcelTable

      public ExcelTable(@RequireNonnull String sheetName, @Nullable Integer tableStartRowNumber, int tableStartColumnNumber)
      Constructs a new instance with the sheet name, the position and the size of the excel table.
      Parameters:
      sheetName - See sheetName.
      tableStartRowNumber - See tableStartRowNumber.
      tableStartColumnNumber - See tableStartColumnNumber.
  • Method Details

    • getSheetName

      @Nonnull public String getSheetName()
      Description copied from interface: IfExcelTable
      Returns the excel sheet name the TableReader and the TableWriter access.
      Specified by:
      getSheetName in interface IfExcelTable<T>
      Returns:
      the sheet name of the excel file
    • getPoiBasisDeterminedTableStartRowNumber

      public int getPoiBasisDeterminedTableStartRowNumber(@RequireNonnull org.apache.poi.ss.usermodel.Sheet sheet, int excelBasisTableStartColumnNumber)
      Returns the row number at which the table starts.

      The minimum value of tableStartRowNumber is zero bacause the top-left of the excel sheet is (1, 1) in R1C1 format, but since apache poi specifies the the top-left of the excel sheet is (0, 0), this method returns the poi-based row number.

      When tableStartRowNumber is set to null, this method will find the string designated with IfExcelTable.getFarLeftAndTopHeaderLabel() from the top row in the column number of excelBasisTableStartColumnNumber.

      Parameters:
      sheet - excel sheet
      Returns:
      the row number the table starts, greater than or equal to 1.
    • getPoiBasisDeterminedTableStartColumnNumber

      public int getPoiBasisDeterminedTableStartColumnNumber()
      Returns tableStartColumnNumber.

      The minimum value of tableStartColumnNumber is zero bacause the top-left of the excel sheet is (1, 1) in R1C1 format, but since apache poi specifies the the top-left of the excel sheet is (0, 0), this method returns the poi-based row number.

      Returns:
      the column number the table starts
    • ignoresAdditionalColumnsOfHeaderData

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

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