Module jp.ecuacion.util.poi
Interface IfExcelTableReader<T>
- Type Parameters:
T- SeeIfExcelTable.
- All Superinterfaces:
IfExcelTable<T>
- All Known Subinterfaces:
IfDataTypeCellExcelTableReader,IfDataTypeStringExcelTableReader,IfFormatFreeExcelTableReader<T>,IfFormatOneLineHeaderExcelTableReader<T>
- All Known Implementing Classes:
CellFreeExcelTableReader,CellOneLineHeaderExcelTableReader,ExcelTableReader,StringExcelTableReader,StringFreeExcelTableReader,StringOneLineHeaderExcelTableReader,StringOneLineHeaderExcelTableToBeanReader
Provides the excel table reader methods.
-
Method Summary
Modifier and TypeMethodDescriptiongetCellData(org.apache.poi.ss.usermodel.Cell cell, int columnNumber) Returns the obtained value from the cell.booleanisCellDataEmpty(T cellData) Returns whether the value of the cell is empty.updateAndGetHeaderData(List<List<T>> tableData) Updates excel data to treat it easily, like remove its header line, and returns the header list.default voidvalidateHeaderData(List<List<T>> headerData) Validates the excel table header.Methods inherited from interface jp.ecuacion.util.poi.excel.table.IfExcelTable
getFarLeftAndTopHeaderLabel, getHeaderLabelData, getNumberOfHeaderLines, getSheetName, getStringValue, ignoresAdditionalColumnsOfHeaderData, ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOpposite, isVerticalAndHorizontalOpposite
-
Method Details
-
validateHeaderData
default void validateHeaderData(@RequireNonnull List<List<T>> headerData) throws jp.ecuacion.util.poi.excel.exception.ExcelAppException Validates the excel table header.- Parameters:
headerData- string header data
The data type isList<List<String>> headerDatabecause the header with multiple lines may exist.
Pass a list with `size() == 0` when it's a table with no header or nothing to validate.- Throws:
jp.ecuacion.util.poi.excel.exception.ExcelAppException- ExcelAppException
-
updateAndGetHeaderData
@Nullable List<List<String>> updateAndGetHeaderData(@Nonnull List<List<T>> tableData) throws jp.ecuacion.util.poi.excel.exception.ExcelAppException Updates excel data to treat it easily, like remove its header line, and returns the header list.Considering various patterns of headers, return type ls
List<List<String>>.- Parameters:
tableData- table data- Returns:
- header data
- Throws:
jp.ecuacion.util.poi.excel.exception.ExcelAppException- ExcelAppException
-
getCellData
@Nullable T getCellData(@RequireNonnull org.apache.poi.ss.usermodel.Cell cell, int columnNumber) throws jp.ecuacion.util.poi.excel.exception.ExcelAppException Returns the obtained value from the cell.If you want to get
Stringvalue from the cell, it returns theStringvalue.- Parameters:
cell- cell, may be null.columnNumber- the column number data is obtained from, starting with 1 and column A is equal to columnNumber 1. When the far left column of a table is 2 and you want to speciries the far left column, the columnNumber is 2.- Returns:
- the obtained value from the cell
- Throws:
jp.ecuacion.util.poi.excel.exception.ExcelAppException- ExcelAppException
-
isCellDataEmpty
boolean isCellDataEmpty(@Nullable T cellData) throws jp.ecuacion.util.poi.excel.exception.ExcelAppException Returns whether the value of the cell is empty.- Parameters:
cellData- cellData- Returns:
- whether the valule of the cell is empty.
- Throws:
jp.ecuacion.util.poi.excel.exception.ExcelAppException
-