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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProvidesIterable.Nested classes/interfaces inherited from class jp.ecuacion.util.poi.excel.table.ExcelTable
ExcelTable.ContextContainer -
Field Summary
Fields inherited from class jp.ecuacion.util.poi.excel.table.ExcelTable
ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOpposite, 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 TypeMethodDescriptiongetIterable(org.apache.poi.ss.usermodel.Workbook workbook) Provides anIterablewriter.protected abstract voidheaderCheck(org.apache.poi.ss.usermodel.Workbook workbook) Obtains header list from the file attemplateFilePath.ignoresAdditionalColumnsOfHeaderData(boolean value) Stores the boolean value which indicates whethervalidateHeaderDataignores additional header columns.isVerticalAndHorizontalOpposite(boolean value) Decides whether header is top (normal table) or left.voidWrites table data to the specified excel file.org.apache.poi.ss.usermodel.WorkbookWrites table data to the designated excel file.voidWrites table data to the designated excel file.Methods inherited from class jp.ecuacion.util.poi.excel.table.ExcelTable
getPoiBasisDeterminedTableStartColumnNumber, getPoiBasisDeterminedTableStartRowNumber, getSheetName, ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOppositeMethods 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, getNumberOfHeaderLines, getSheetName, getStringValue, ignoresAdditionalColumnsOfHeaderData, isVerticalAndHorizontalOppositeMethods 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(@RequireNonnull String templateFilePath, @RequireNonnull String destFilePath, @RequireNonnull List<List<T>> data) throws Exception Writes table data to the specified excel file.datais written todestFilePath, and then workbook is closed.- Parameters:
destFilePath- destFilePathdata- dataList- Throws:
Exception
-
write
public org.apache.poi.ss.usermodel.Workbook write(@RequireNonnull String templateFilePath, @RequireNonnull List<List<T>> data) throws Exception Writes table data to the designated excel file.datais stored toworkbookcreated fromtemplateFilePath, and the method returnsworkbook.- Parameters:
templateFilePath- templateFilePathdata- data- Throws:
Exception
-
write
public void write(@RequireNonnull org.apache.poi.ss.usermodel.Workbook workbook, @RequireNonnull List<List<T>> data) throws Exception Writes table data to the designated excel file.datais stored toworkbook.- Parameters:
workbook- workbookdata- dataList- Throws:
Exception
-
getIterable
@Nonnull public ExcelTableWriter.IterableWriter<T> getIterable(@RequireNonnull org.apache.poi.ss.usermodel.Workbook workbook) throws org.apache.poi.EncryptedDocumentException, jp.ecuacion.lib.core.exception.checked.AppException, IOException Provides anIterablewriter.- Parameters:
workbook- workbook- Throws:
org.apache.poi.EncryptedDocumentExceptionjp.ecuacion.lib.core.exception.checked.AppExceptionIOException
-
headerCheck
protected abstract void headerCheck(@RequireNonnull org.apache.poi.ss.usermodel.Workbook workbook) throws org.apache.poi.EncryptedDocumentException, jp.ecuacion.lib.core.exception.checked.AppException, IOException Obtains header list from the file attemplateFilePath.- Parameters:
workbook- workbook.- Throws:
IOException- IOExceptionjp.ecuacion.lib.core.exception.checked.AppException- AppExceptionorg.apache.poi.EncryptedDocumentException- EncryptedDocumentException
-
ignoresAdditionalColumnsOfHeaderData
Description copied from interface:IfExcelTableStores the boolean value which indicates whethervalidateHeaderDataignores additional header columns.- Specified by:
ignoresAdditionalColumnsOfHeaderDatain interfaceIfExcelTable<T>- Parameters:
value- boolean
-
isVerticalAndHorizontalOpposite
Description copied from interface:IfExcelTableDecides whether header is top (normal table) or left.truemeans headers are at the left.- Specified by:
isVerticalAndHorizontalOppositein interfaceIfExcelTable<T>- Parameters:
value- boolean- Returns:
IfExcelTable<T>
-