java.lang.Object
jp.ecuacion.util.poi.excel.util.ExcelReadUtil
Provides excel-related
apache POI utility methods.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance withNoDataString = NULL.ExcelReadUtil(NoDataString noDataString) Constructs a new instance with designatedNoDataString. -
Method Summary
Modifier and TypeMethodDescriptiongetNoDataStringIfNoData(String value) Returns properNoDataStringvalue if the argument value isnullor"", otherwize returns the argument value.getStringFromCell(org.apache.poi.ss.usermodel.Cell cell) ReturnsStringformat cell value in spite of the format or value kind of the cell.getStringFromCell(org.apache.poi.ss.usermodel.Cell cell, String dateTimeFormat) ReturnsStringformat cell value in spite of the format or value kind of the cell.voidsetDefaultDateTimeFormat(String dateTimeFormat) Sets defaultDateTimeFormat.
-
Constructor Details
-
ExcelReadUtil
public ExcelReadUtil()Constructs a new instance withNoDataString = NULL.NoDataString = NULLis recommended. SeeNoDataString. -
ExcelReadUtil
Constructs a new instance with designatedNoDataString.NoDataString = NULLis recommended. SeeNoDataString.- Parameters:
noDataString- noDataString
-
-
Method Details
-
setDefaultDateTimeFormat
Sets defaultDateTimeFormat.- Parameters:
dateTimeFormat- dateTimeFormat
-
getNoDataStringIfNoData
Returns properNoDataStringvalue if the argument value isnullor"", otherwize returns the argument value.- Parameters:
value- value, may benull.- Returns:
- the argument value or the empty string designated by
noDataStringwhen the argument value is empty.
-
getStringFromCell
ReturnsStringformat cell value in spite of the format or value kind of the cell.- Parameters:
cell- the cell of the excel file- Returns:
- the string which expresses the value of the cell.
-
getStringFromCell
@Nullable public String getStringFromCell(@Nullable org.apache.poi.ss.usermodel.Cell cell, String dateTimeFormat) ReturnsStringformat cell value in spite of the format or value kind of the cell.- Parameters:
cell- the cell of the excel filedateTimeFormat- dateTimeFormat, may benullin which casedefaultDateTimeFormatis used.- Returns:
- the string which expresses the value of the cell.
-