Module jp.ecuacion.util.poi
Class ExcelTableWriter<T>
java.lang.Object
jp.ecuacion.util.poi.excel.table.ExcelTable<T>
jp.ecuacion.util.poi.excel.table.writer.ExcelTableWriter<T>
- Type Parameters:
T- SeeIfExcelTable.
- All Implemented Interfaces:
IfExcelTable<T>,IfExcelTableWriter<T>
- Direct Known Subclasses:
CellFreeExcelTableWriter,CellOneLineHeaderExcelTableWriter
Is a parent of excel table writer classes.
-
Field Summary
Fields inherited from class jp.ecuacion.util.poi.excel.table.ExcelTable
sheetName, tableStartColumnNumber, tableStartRowNumber -
Constructor Summary
ConstructorsConstructorDescriptionExcelTableWriter(String sheetName, Integer tableStartRowNumber, int tableStartColumnNumber) Constructs a new instance with the sheet name, the position of the excel table. -
Method Summary
Modifier and TypeMethodDescriptiongetHeaderData(String templateFilePath, int tableColumnSize) Obtains header list from the file attemplateFilePath.voidWrites table data to the designated excel file.Methods inherited from class jp.ecuacion.util.poi.excel.table.ExcelTable
getPoiBasisDeterminedTableStartColumnNumber, getPoiBasisDeterminedTableStartRowNumber, getSheetNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jp.ecuacion.util.poi.excel.table.IfExcelTable
getFarLeftAndTopHeaderLabel, getHeaderLabelData, getSheetName, getStringValue, validateHeaderDataMethods inherited from interface jp.ecuacion.util.poi.excel.table.writer.IfExcelTableWriter
writeToCell
-
Constructor Details
-
ExcelTableWriter
public ExcelTableWriter(@RequireNonnull String sheetName, @Nullable Integer tableStartRowNumber, int tableStartColumnNumber) Constructs a new instance with the sheet name, the position of the excel table.- Parameters:
sheetName- SeeExcelTable.sheetName.tableStartRowNumber- SeeExcelTable.tableStartRowNumber.tableStartColumnNumber- SeeExcelTable.tableStartColumnNumber.
-
-
Method Details
-
write
public void write(@Nullable String templateFilePath, @RequireNonnull String destFilePath, @RequireNonnull List<List<T>> data) throws Exception Writes table data to the designated excel file.- Parameters:
destFilePath- destFilePathdata- dataList- Throws:
Exception
-
getHeaderData
@Nonnull protected abstract List<List<String>> getHeaderData(@Nullable String templateFilePath, int tableColumnSize) throws org.apache.poi.EncryptedDocumentException, jp.ecuacion.lib.core.exception.checked.AppException, IOException Obtains header list from the file attemplateFilePath.- Parameters:
templateFilePath- nullable when the data is written to a new excel file.tableColumnSize- tableColumnSize- Returns:
- the list of
String, may be an empty list whentemplateFilePathisnull. - Throws:
IOException- IOExceptionjp.ecuacion.lib.core.exception.checked.AppException- AppExceptionorg.apache.poi.EncryptedDocumentException- EncryptedDocumentException
-