Class StringOneLineHeaderExcelTableReader
- All Implemented Interfaces:
IfDataTypeStringExcelTable, IfExcelTable<String>, IfFormatOneLineHeaderExcelTable<String>, IfDataTypeStringExcelTableReader, IfExcelTableReader<String>, IfFormatOneLineHeaderExcelTableReader<String>
- Direct Known Subclasses:
StringOneLineHeaderExcelTableToBeanReader
It obtains cell values as String.
The header line is required.
This class reads the table at the designated position and designated lines and columns.
Finish reading if all the columns are empty in a line.
-
Nested Class Summary
Nested classes/interfaces inherited from class ExcelTableReader
ExcelTableReader.IterableReader<T>, ExcelTableReader.IteratorReader<T>Nested classes/interfaces inherited from class ExcelTable
ExcelTable.ContextContainer -
Field Summary
Fields inherited from class StringExcelTableReader
columnDateTimeFormatMap, dateTimeFormatFields inherited from class ExcelTableReader
tableColumnSizeGivenByConstructor, tableRowSizeGivenByConstructorFields inherited from class ExcelTable
ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOpposite, sheetName, tableStartColumnNumber, tableStartRowNumber -
Constructor Summary
ConstructorsConstructorDescriptionStringOneLineHeaderExcelTableReader(String sheetName, String[] headerLabels, Integer tableStartRowNumber, int tableStartColumnNumber, Integer tableRowSize) Constructs a new instance. the obtained value from an empty cell isnull.StringOneLineHeaderExcelTableReader(String sheetName, String[] headerLabels, Integer tableStartRowNumber, int tableStartColumnNumber, Integer tableRowSize, NoDataString noDataString) Constructs a new instance with the obtained value from an empty cell. -
Method Summary
Modifier and TypeMethodDescriptioncolumnDateTimeFormat(int columnNumber, DateTimeFormatter dateTimeFormat) Sets dateTimeFormat for specific column.defaultDateTimeFormat(DateTimeFormatter dateTimeFormat) Sets defaultDateTimeFormat.String[]Defines the header labels in the excel table.Gets NoDataString.Methods inherited from class StringExcelTableReader
getDateTimeFormatMethods inherited from class ExcelTableReader
getIterable, getReadyToReadTableData, getTableColumnSize, getTableRowSize, ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOpposite, read, read, setTableColumnSizeMethods inherited from class ExcelTable
getPoiBasisDeterminedTableStartColumnNumber, getPoiBasisDeterminedTableStartRowNumber, getSheetName, ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOppositeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IfDataTypeStringExcelTable
getStringValueMethods inherited from interface IfDataTypeStringExcelTableReader
getCellData, isCellDataEmptyMethods inherited from interface IfExcelTable
getSheetName, ignoresAdditionalColumnsOfHeaderData, ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOpposite, isVerticalAndHorizontalOppositeMethods inherited from interface IfExcelTableReader
validateHeaderDataMethods inherited from interface IfFormatOneLineHeaderExcelTable
getFarLeftAndTopHeaderLabel, getHeaderLabelData, getNumberOfHeaderLinesMethods inherited from interface IfFormatOneLineHeaderExcelTableReader
updateAndGetHeaderData
-
Constructor Details
-
StringOneLineHeaderExcelTableReader
public StringOneLineHeaderExcelTableReader(@RequireNonnull String sheetName, @RequireNonnull String[] headerLabels, Integer tableStartRowNumber, int tableStartColumnNumber, @Nullable Integer tableRowSize) Constructs a new instance. the obtained value from an empty cell isnull.tableColumnSizeis not designated becausetableColumnSizeof the table is obviously equal to the length of the header array.About the params
sheetName,tableStartRowNumber,tableStartColumnNumber,tableRowSizeandtableColumnSize, seeExcelTableReader(String, Integer, int, Integer, Integer). -
StringOneLineHeaderExcelTableReader
public StringOneLineHeaderExcelTableReader(@RequireNonnull String sheetName, @RequireNonnull String[] headerLabels, @Nullable Integer tableStartRowNumber, int tableStartColumnNumber, @Nullable Integer tableRowSize, @Nonnull NoDataString noDataString) Constructs a new instance with the obtained value from an empty cell.tableColumnSizeis not designated becausetableColumnSizeof the table is obviously equal to the length of the header array.About the params
sheetName,tableStartRowNumber,tableStartColumnNumber,tableRowSizeandtableColumnSize, seeExcelTableReader(String, Integer, int, Integer, Integer).- Parameters:
sheetName- the sheet name of the excel filetableStartRowNumber- tableStartRowNumbertableStartColumnNumber- tableStartColumnNumbertableRowSize- tableRowSizenoDataString- the obtained value from an empty cell.nullor"".
-
-
Method Details
-
getHeaderLabels
Description copied from interface:IfFormatOneLineHeaderExcelTableDefines the header labels in the excel table.It can be like
new String[] {"first name", "last name", "age"}.- Specified by:
getHeaderLabelsin interfaceIfFormatOneLineHeaderExcelTable<String>
-
getNoDataString
Description copied from interface:IfDataTypeStringExcelTableReaderGets NoDataString.- Specified by:
getNoDataStringin interfaceIfDataTypeStringExcelTableReader- Returns:
- NoDataString
-
defaultDateTimeFormat
Description copied from class:StringExcelTableReaderSets defaultDateTimeFormat.- Overrides:
defaultDateTimeFormatin classStringExcelTableReader- Parameters:
dateTimeFormat- dateTimeFormat string forDateTimeFormatter.- Returns:
- StringExcelTableReader (for method chain)
-
columnDateTimeFormat
public StringOneLineHeaderExcelTableReader columnDateTimeFormat(int columnNumber, DateTimeFormatter dateTimeFormat) Description copied from class:StringExcelTableReaderSets dateTimeFormat for specific column.- Overrides:
columnDateTimeFormatin classStringExcelTableReader- Parameters:
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.dateTimeFormat- dateTimeFormat string forDateTimeFormatter.- Returns:
- StringExcelTableReader (for method chain)
-