From a147f714622322e48245331751b513cae07b72f9 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Tue, 26 Oct 2021 10:40:25 +0800 Subject: [PATCH 01/12] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D=E5=86=99=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E6=80=A7=E8=83=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/context/WriteContextImpl.java | 11 ++--- .../alibaba/excel/util/WriteHandlerUtils.java | 43 +++++++++++-------- .../executor/AbstractExcelWriteExecutor.java | 9 ++-- .../write/executor/ExcelWriteAddExecutor.java | 33 ++++++++------ .../impl/FillStyleCellWriteHandler.java | 5 +-- update.md | 3 ++ 6 files changed, 60 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java index f31705f7..1c3727bf 100644 --- a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java @@ -228,9 +228,9 @@ public class WriteContextImpl implements WriteContext { + newRowIndex; i++, relativeRowIndex++) { WriteHandlerUtils.beforeRowCreate(this, newRowIndex, relativeRowIndex, Boolean.TRUE); Row row = WorkBookUtil.createRow(writeSheetHolder.getSheet(), i); - WriteHandlerUtils.afterRowCreate(this, row, relativeRowIndex, Boolean.TRUE); + WriteHandlerUtils.afterRowCreate(this, row, i, relativeRowIndex, Boolean.TRUE); addOneRowOfHeadDataToExcel(row, excelWriteHeadProperty.getHeadMap(), relativeRowIndex); - WriteHandlerUtils.afterRowDispose(this, row, relativeRowIndex, Boolean.TRUE); + WriteHandlerUtils.afterRowDispose(this, row, i, relativeRowIndex, Boolean.TRUE); } } @@ -254,13 +254,14 @@ public class WriteContextImpl implements WriteContext { Cell cell = row.createCell(columnIndex); - WriteHandlerUtils.afterCellCreate(this, cell, head, relativeRowIndex, Boolean.TRUE, excelContentProperty); + WriteHandlerUtils.afterCellCreate(this, cell, row, head, columnIndex, relativeRowIndex, Boolean.TRUE, + excelContentProperty); WriteCellData writeCellData = new WriteCellData<>(head.getHeadNameList().get(relativeRowIndex)); cell.setCellValue(writeCellData.getStringValue()); - WriteHandlerUtils.afterCellDispose(this, writeCellData, cell, head, relativeRowIndex, Boolean.TRUE, - excelContentProperty); + WriteHandlerUtils.afterCellDispose(this, writeCellData, cell, row, head, columnIndex, relativeRowIndex, + Boolean.TRUE, excelContentProperty); } } diff --git a/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java b/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java index 78ce8d8e..1ea362b0 100644 --- a/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java +++ b/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java @@ -133,16 +133,16 @@ public class WriteHandlerUtils { } } - public static void afterCellCreate(WriteContext writeContext, Cell cell, Head head, Integer relativeRowIndex, - Boolean isHead, ExcelContentProperty excelContentProperty) { + public static void afterCellCreate(WriteContext writeContext, Cell cell, Row row, Head head, + Integer columnIndex, Integer relativeRowIndex, Boolean isHead, ExcelContentProperty excelContentProperty) { List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(CellWriteHandler.class); if (handlerList == null || handlerList.isEmpty()) { return; } CellWriteHandlerContext context = new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), cell.getRow(), cell, - cell.getColumnIndex(), relativeRowIndex, head, null, null, isHead, excelContentProperty); + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, cell, columnIndex, relativeRowIndex, + head, null, null, isHead, excelContentProperty); for (WriteHandler writeHandler : handlerList) { if (writeHandler instanceof CellWriteHandler) { ((CellWriteHandler)writeHandler).afterCellCreate(context); @@ -150,8 +150,9 @@ public class WriteHandlerUtils { } } - public static void afterCellDataConverted(WriteContext writeContext, WriteCellData cellData, Cell cell, - Head head, Integer relativeRowIndex, Boolean isHead, ExcelContentProperty excelContentProperty) { + public static void afterCellDataConverted(WriteContext writeContext, WriteCellData cellData, Cell cell, Row row, + Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, + ExcelContentProperty excelContentProperty) { List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(CellWriteHandler.class); if (handlerList == null || handlerList.isEmpty()) { @@ -159,8 +160,8 @@ public class WriteHandlerUtils { } List> cellDataList = cellData == null ? null : ListUtils.newArrayList(cellData); CellWriteHandlerContext context = new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), cell.getRow(), cell, - cell.getColumnIndex(), relativeRowIndex, head, cellDataList, cellData, isHead, excelContentProperty); + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, cell, + columnIndex, relativeRowIndex, head, cellDataList, cellData, isHead, excelContentProperty); for (WriteHandler writeHandler : handlerList) { if (writeHandler instanceof CellWriteHandler) { ((CellWriteHandler)writeHandler).afterCellDataConverted(context); @@ -168,14 +169,17 @@ public class WriteHandlerUtils { } } - public static void afterCellDispose(WriteContext writeContext, WriteCellData cellData, Cell cell, Head head, - Integer relativeRowIndex, Boolean isHead, ExcelContentProperty excelContentProperty) { + public static void afterCellDispose(WriteContext writeContext, WriteCellData cellData, Cell cell, Row row, + Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, + ExcelContentProperty excelContentProperty) { List> cellDataList = cellData == null ? null : ListUtils.newArrayList(cellData); - afterCellDispose(writeContext, cellDataList, cell, head, relativeRowIndex, isHead, excelContentProperty); + afterCellDispose(writeContext, cellDataList, cell, row, head, columnIndex, relativeRowIndex, isHead, + excelContentProperty); } public static void afterCellDispose(WriteContext writeContext, List> cellDataList, Cell cell, - Head head, Integer relativeRowIndex, Boolean isHead, ExcelContentProperty excelContentProperty) { + Row row, Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, + ExcelContentProperty excelContentProperty) { List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(CellWriteHandler.class); if (handlerList == null || handlerList.isEmpty()) { @@ -186,8 +190,8 @@ public class WriteHandlerUtils { cellData = cellDataList.get(0); } CellWriteHandlerContext context = new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), cell.getRow(), cell, - cell.getColumnIndex(), relativeRowIndex, head, cellDataList, cellData, isHead, excelContentProperty); + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, cell, columnIndex, relativeRowIndex, + head, cellDataList, cellData, isHead, excelContentProperty); for (WriteHandler writeHandler : handlerList) { if (writeHandler instanceof CellWriteHandler) { ((CellWriteHandler)writeHandler).afterCellDispose(context); @@ -210,13 +214,14 @@ public class WriteHandlerUtils { } } - public static void afterRowCreate(WriteContext writeContext, Row row, Integer relativeRowIndex, Boolean isHead) { + public static void afterRowCreate(WriteContext writeContext, Row row, Integer rowIndex, Integer relativeRowIndex, + Boolean isHead) { List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(RowWriteHandler.class); if (handlerList == null || handlerList.isEmpty()) { return; } RowWriteHandlerContext context = new RowWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row.getRowNum(), row, relativeRowIndex, + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, row, relativeRowIndex, isHead); for (WriteHandler writeHandler : handlerList) { if (writeHandler instanceof RowWriteHandler) { @@ -225,14 +230,14 @@ public class WriteHandlerUtils { } } - public static void afterRowDispose(WriteContext writeContext, Row row, Integer relativeRowIndex, Boolean isHead) { + public static void afterRowDispose(WriteContext writeContext, Row row, Integer rowIndex, Integer relativeRowIndex, + Boolean isHead) { List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(RowWriteHandler.class); if (handlerList == null || handlerList.isEmpty()) { return; } RowWriteHandlerContext context = new RowWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row.getRowNum(), row, relativeRowIndex, - isHead); + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, row, relativeRowIndex, isHead); for (WriteHandler writeHandler : handlerList) { if (writeHandler instanceof RowWriteHandler) { ((RowWriteHandler)writeHandler).afterRowDispose(context); diff --git a/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java b/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java index 597d94de..7c94e178 100644 --- a/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java @@ -32,6 +32,7 @@ import org.apache.poi.ss.usermodel.Comment; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.ss.usermodel.Drawing; import org.apache.poi.ss.usermodel.Hyperlink; +import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.usermodel.XSSFClientAnchor; @@ -48,16 +49,16 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { } protected WriteCellData converterAndSet(WriteHolder currentWriteHolder, Class clazz, - CellDataTypeEnum targetType, Cell cell, Object value, ExcelContentProperty excelContentProperty, Head head, - Integer relativeRowIndex, int rowIndex, int columnIndex) { + CellDataTypeEnum targetType, Cell cell, Row row, Object value, ExcelContentProperty excelContentProperty, + Head head, Integer relativeRowIndex, int rowIndex, int columnIndex) { boolean needTrim = value != null && (value instanceof String && currentWriteHolder.globalConfiguration() .getAutoTrim()); if (needTrim) { value = ((String)value).trim(); } WriteCellData cellData = convert(currentWriteHolder, clazz, targetType, cell, value, excelContentProperty); - WriteHandlerUtils.afterCellDataConverted(writeContext, cellData, cell, head, relativeRowIndex, Boolean.FALSE, - excelContentProperty); + WriteHandlerUtils.afterCellDataConverted(writeContext, cellData, cell, row, head, columnIndex, relativeRowIndex, + Boolean.FALSE, excelContentProperty); // Fill in picture information fillImage(cell, cellData.getImageDataList()); diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java index bdfea49e..db0f7247 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java @@ -66,7 +66,7 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { } WriteHandlerUtils.beforeRowCreate(writeContext, rowIndex, relativeRowIndex, Boolean.FALSE); Row row = WorkBookUtil.createRow(writeContext.writeSheetHolder().getSheet(), rowIndex); - WriteHandlerUtils.afterRowCreate(writeContext, row, relativeRowIndex, Boolean.FALSE); + WriteHandlerUtils.afterRowCreate(writeContext, row, rowIndex, relativeRowIndex, Boolean.FALSE); if (oneRowData instanceof Collection) { addBasicTypeToExcel(new CollectionRowData((Collection)oneRowData), row, rowIndex, relativeRowIndex); @@ -75,7 +75,7 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { } else { addJavaObjectToExcel(oneRowData, row, rowIndex, relativeRowIndex, sortedAllFiledMap); } - WriteHandlerUtils.afterRowDispose(writeContext, row, relativeRowIndex, Boolean.FALSE); + WriteHandlerUtils.afterRowDispose(writeContext, row, rowIndex, relativeRowIndex, Boolean.FALSE); } private void addBasicTypeToExcel(RowData oneRowData, Row row, int rowIndex, int relativeRowIndex) { @@ -117,12 +117,14 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { WriteHandlerUtils.beforeCellCreate(writeContext, row, head, columnIndex, relativeRowIndex, Boolean.FALSE, excelContentProperty); Cell cell = WorkBookUtil.createCell(row, columnIndex); - WriteHandlerUtils.afterCellCreate(writeContext, cell, head, relativeRowIndex, Boolean.FALSE, + WriteHandlerUtils.afterCellCreate(writeContext, cell, row, head, columnIndex, relativeRowIndex, Boolean.FALSE, excelContentProperty); Object value = oneRowData.get(dataIndex); WriteCellData cellData = converterAndSet(writeContext.currentWriteHolder(), - FieldUtils.getFieldClass(value), null, cell, value, null, head, relativeRowIndex, rowIndex, columnIndex); - WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, head, relativeRowIndex, Boolean.FALSE, + FieldUtils.getFieldClass(value), null, cell, row, value, null, head, relativeRowIndex, + rowIndex, columnIndex); + WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, row, head, columnIndex, relativeRowIndex, + Boolean.FALSE, excelContentProperty); } @@ -147,12 +149,14 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { WriteHandlerUtils.beforeCellCreate(writeContext, row, head, columnIndex, relativeRowIndex, Boolean.FALSE, excelContentProperty); Cell cell = WorkBookUtil.createCell(row, columnIndex); - WriteHandlerUtils.afterCellCreate(writeContext, cell, head, relativeRowIndex, Boolean.FALSE, + WriteHandlerUtils.afterCellCreate(writeContext, cell, row, head, columnIndex, relativeRowIndex, + Boolean.FALSE, excelContentProperty); Object value = beanMap.get(name); WriteCellData cellData = converterAndSet(currentWriteHolder, head.getField().getType(), - null, cell, value, excelContentProperty, head, relativeRowIndex, rowIndex, columnIndex); - WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, head, relativeRowIndex, Boolean.FALSE, + null, cell, row, value, excelContentProperty, head, relativeRowIndex, rowIndex, columnIndex); + WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, row, head, columnIndex, + relativeRowIndex, Boolean.FALSE, excelContentProperty); beanMapHandledSet.add(name); maxCellIndex = Math.max(maxCellIndex, columnIndex); @@ -181,14 +185,17 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { excelContentProperty); // fix https://github.com/alibaba/easyexcel/issues/1870 // If there is data, it is written to the next cell - Cell cell = WorkBookUtil.createCell(row, maxCellIndex++); - WriteHandlerUtils.afterCellCreate(writeContext, cell, null, relativeRowIndex, Boolean.FALSE, + Cell cell = WorkBookUtil.createCell(row, maxCellIndex); + WriteHandlerUtils.afterCellCreate(writeContext, cell, row, null, maxCellIndex, relativeRowIndex, + Boolean.FALSE, excelContentProperty); WriteCellData cellData = converterAndSet(currentWriteHolder, - FieldUtils.getFieldClass(beanMap, filedName, value), null, cell, value, null, null, relativeRowIndex, - rowIndex, maxCellIndex); - WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, null, relativeRowIndex, Boolean.FALSE, + FieldUtils.getFieldClass(beanMap, filedName, value), null, cell, row, value, null, null, + relativeRowIndex, rowIndex, maxCellIndex); + WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, row, null, maxCellIndex, relativeRowIndex, + Boolean.FALSE, excelContentProperty); + maxCellIndex++; } } diff --git a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java index c8116b4d..819da9b1 100644 --- a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java +++ b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java @@ -6,7 +6,6 @@ import com.alibaba.excel.constant.OrderConstant; import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.write.handler.CellWriteHandler; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; -import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import lombok.extern.slf4j.Slf4j; @@ -41,8 +40,8 @@ public class FillStyleCellWriteHandler implements CellWriteHandler { if (writeCellStyle == null && originCellStyle == null) { return; } - WriteWorkbookHolder writeWorkbookHolder = context.getWriteWorkbookHolder(); - context.getCell().setCellStyle(writeWorkbookHolder.createCellStyle(writeCellStyle, originCellStyle)); + //WriteWorkbookHolder writeWorkbookHolder = context.getWriteWorkbookHolder(); + //context.getCell().setCellStyle(writeWorkbookHolder.createCellStyle(writeCellStyle, originCellStyle)); } } diff --git a/update.md b/update.md index fdec0ee3..6cc837de 100644 --- a/update.md +++ b/update.md @@ -1,3 +1,6 @@ +# 3.0.2 +* 修复写入的性能问题 + # 3.0.1 * 升级到正式版 * 修复填充样式可能丢失的问题 [Issue #2124](https://github.com/alibaba/easyexcel/issues/2124) From f43ed9307125819907a9ce03f53ff71ae90a32fc Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Tue, 26 Oct 2021 14:55:39 +0800 Subject: [PATCH 02/12] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D=E5=86=99=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E6=80=A7=E8=83=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/context/WriteContextImpl.java | 69 +++-- .../excel/converters/ConverterKeyBuild.java | 47 +-- .../converters/DefaultConverterLoader.java | 11 +- .../exception/ExcelDataConvertException.java | 4 +- .../ExcelWriteDataConvertException.java | 32 +++ .../excel/metadata/AbstractHolder.java | 5 +- .../excel/metadata/ConfigurationHolder.java | 5 +- .../excel/metadata/data/WriteCellData.java | 5 - .../alibaba/excel/util/ConverterUtils.java | 5 +- .../alibaba/excel/util/WriteHandlerUtils.java | 269 ++++++++---------- .../executor/AbstractExcelWriteExecutor.java | 178 +++++++----- .../write/executor/ExcelWriteAddExecutor.java | 93 +++--- .../executor/ExcelWriteFillExecutor.java | 88 ++++-- .../context/CellWriteHandlerContext.java | 58 +++- .../context/RowWriteHandlerContext.java | 8 + .../context/SheetWriteHandlerContext.java | 12 + .../context/WorkbookWriteHandlerContext.java | 13 + .../impl/FillStyleCellWriteHandler.java | 10 +- .../metadata/holder/AbstractWriteHolder.java | 1 + .../metadata/holder/WriteSheetHolder.java | 2 - .../metadata/holder/WriteWorkbookHolder.java | 6 + 21 files changed, 559 insertions(+), 362 deletions(-) create mode 100644 src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java diff --git a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java index 1c3727bf..7ee3b2c9 100644 --- a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java @@ -15,10 +15,15 @@ import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.util.ClassUtils; import com.alibaba.excel.util.DateUtils; import com.alibaba.excel.util.FileUtils; +import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.NumberDataFormatterUtils; import com.alibaba.excel.util.StringUtils; import com.alibaba.excel.util.WorkBookUtil; import com.alibaba.excel.util.WriteHandlerUtils; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.handler.context.RowWriteHandlerContext; +import com.alibaba.excel.write.handler.context.SheetWriteHandlerContext; +import com.alibaba.excel.write.handler.context.WorkbookWriteHandlerContext; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteTable; import com.alibaba.excel.write.metadata.WriteWorkbook; @@ -83,13 +88,16 @@ public class WriteContextImpl implements WriteContext { LOGGER.debug("Begin to Initialization 'WriteContextImpl'"); } initCurrentWorkbookHolder(writeWorkbook); - WriteHandlerUtils.beforeWorkbookCreate(this); + + WorkbookWriteHandlerContext workbookWriteHandlerContext = WriteHandlerUtils.createWorkbookWriteHandlerContext( + this); + WriteHandlerUtils.beforeWorkbookCreate(workbookWriteHandlerContext); try { WorkBookUtil.createWorkBook(writeWorkbookHolder); } catch (Exception e) { throw new ExcelGenerateException("Create workbook failure", e); } - WriteHandlerUtils.afterWorkbookCreate(this); + WriteHandlerUtils.afterWorkbookCreate(workbookWriteHandlerContext); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Initialization 'WriteContextImpl' complete"); } @@ -118,8 +126,10 @@ public class WriteContextImpl implements WriteContext { initCurrentSheetHolder(writeSheet); // Workbook handler need to supplementary execution - WriteHandlerUtils.beforeWorkbookCreate(this, true); - WriteHandlerUtils.afterWorkbookCreate(this, true); + WorkbookWriteHandlerContext workbookWriteHandlerContext = WriteHandlerUtils.createWorkbookWriteHandlerContext( + this, true); + WriteHandlerUtils.beforeWorkbookCreate(workbookWriteHandlerContext, true); + WriteHandlerUtils.afterWorkbookCreate(workbookWriteHandlerContext, true); // Initialization current sheet initSheet(writeType); @@ -162,7 +172,8 @@ public class WriteContextImpl implements WriteContext { } private void initSheet(WriteTypeEnum writeType) { - WriteHandlerUtils.beforeSheetCreate(this); + SheetWriteHandlerContext sheetWriteHandlerContext = WriteHandlerUtils.createSheetWriteHandlerContext(this); + WriteHandlerUtils.beforeSheetCreate(sheetWriteHandlerContext); Sheet currentSheet; try { if (writeSheetHolder.getSheetNo() != null) { @@ -192,7 +203,7 @@ public class WriteContextImpl implements WriteContext { currentSheet = createSheet(); } writeSheetHolder.setSheet(currentSheet); - WriteHandlerUtils.afterSheetCreate(this); + WriteHandlerUtils.afterSheetCreate(sheetWriteHandlerContext); if (WriteTypeEnum.ADD.equals(writeType)) { // Initialization head initHead(writeSheetHolder.excelWriteHeadProperty()); @@ -226,11 +237,17 @@ public class WriteContextImpl implements WriteContext { } for (int relativeRowIndex = 0, i = newRowIndex; i < excelWriteHeadProperty.getHeadRowNumber() + newRowIndex; i++, relativeRowIndex++) { - WriteHandlerUtils.beforeRowCreate(this, newRowIndex, relativeRowIndex, Boolean.TRUE); + + RowWriteHandlerContext rowWriteHandlerContext = WriteHandlerUtils.createRowWriteHandlerContext(this, + newRowIndex, relativeRowIndex, Boolean.TRUE); + WriteHandlerUtils.beforeRowCreate(rowWriteHandlerContext); + Row row = WorkBookUtil.createRow(writeSheetHolder.getSheet(), i); - WriteHandlerUtils.afterRowCreate(this, row, i, relativeRowIndex, Boolean.TRUE); - addOneRowOfHeadDataToExcel(row, excelWriteHeadProperty.getHeadMap(), relativeRowIndex); - WriteHandlerUtils.afterRowDispose(this, row, i, relativeRowIndex, Boolean.TRUE); + rowWriteHandlerContext.setRow(row); + + WriteHandlerUtils.afterRowCreate(rowWriteHandlerContext); + addOneRowOfHeadDataToExcel(row, i, excelWriteHeadProperty.getHeadMap(), relativeRowIndex); + WriteHandlerUtils.afterRowDispose(rowWriteHandlerContext); } } @@ -242,26 +259,29 @@ public class WriteContextImpl implements WriteContext { } } - private void addOneRowOfHeadDataToExcel(Row row, Map headMap, int relativeRowIndex) { + private void addOneRowOfHeadDataToExcel(Row row, Integer rowIndex, Map headMap, + int relativeRowIndex) { for (Map.Entry entry : headMap.entrySet()) { Head head = entry.getValue(); int columnIndex = entry.getKey(); ExcelContentProperty excelContentProperty = ClassUtils.declaredExcelContentProperty(null, currentWriteHolder.excelWriteHeadProperty().getHeadClazz(), head.getFieldName()); - WriteHandlerUtils.beforeCellCreate(this, row, head, columnIndex, relativeRowIndex, Boolean.TRUE, - excelContentProperty); + CellWriteHandlerContext cellWriteHandlerContext = WriteHandlerUtils.createCellWriteHandlerContext(this, row, + rowIndex, head, columnIndex, relativeRowIndex, Boolean.TRUE, excelContentProperty); + WriteHandlerUtils.beforeCellCreate(cellWriteHandlerContext); Cell cell = row.createCell(columnIndex); + cellWriteHandlerContext.setCell(cell); - WriteHandlerUtils.afterCellCreate(this, cell, row, head, columnIndex, relativeRowIndex, Boolean.TRUE, - excelContentProperty); + WriteHandlerUtils.afterCellCreate(cellWriteHandlerContext); WriteCellData writeCellData = new WriteCellData<>(head.getHeadNameList().get(relativeRowIndex)); cell.setCellValue(writeCellData.getStringValue()); + cellWriteHandlerContext.setCellDataList(ListUtils.newArrayList(writeCellData)); + cellWriteHandlerContext.setFirstCellData(writeCellData); - WriteHandlerUtils.afterCellDispose(this, writeCellData, cell, row, head, columnIndex, relativeRowIndex, - Boolean.TRUE, excelContentProperty); + WriteHandlerUtils.afterCellDispose(cellWriteHandlerContext); } } @@ -289,10 +309,15 @@ public class WriteContextImpl implements WriteContext { initCurrentTableHolder(writeTable); // Workbook and sheet handler need to supplementary execution - WriteHandlerUtils.beforeWorkbookCreate(this, true); - WriteHandlerUtils.afterWorkbookCreate(this, true); - WriteHandlerUtils.beforeSheetCreate(this, true); - WriteHandlerUtils.afterSheetCreate(this, true); + WorkbookWriteHandlerContext workbookWriteHandlerContext = WriteHandlerUtils.createWorkbookWriteHandlerContext( + this, true); + WriteHandlerUtils.beforeWorkbookCreate(workbookWriteHandlerContext, true); + WriteHandlerUtils.afterWorkbookCreate(workbookWriteHandlerContext, true); + + SheetWriteHandlerContext sheetWriteHandlerContext = WriteHandlerUtils.createSheetWriteHandlerContext(this, + true); + WriteHandlerUtils.beforeSheetCreate(sheetWriteHandlerContext, true); + WriteHandlerUtils.afterSheetCreate(sheetWriteHandlerContext, true); initHead(writeTableHolder.excelWriteHeadProperty()); } @@ -332,7 +357,7 @@ public class WriteContextImpl implements WriteContext { return; } finished = true; - WriteHandlerUtils.afterWorkbookDispose(this); + WriteHandlerUtils.afterWorkbookDispose(writeWorkbookHolder.getWorkbookWriteHandlerContext()); if (writeWorkbookHolder == null) { return; } diff --git a/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java b/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java index f1068591..5fe8f0bc 100644 --- a/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java +++ b/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java @@ -5,6 +5,9 @@ import java.util.Map; import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.util.MapUtils; +import lombok.AllArgsConstructor; +import lombok.Data; + /** * Converter unique key.Consider that you can just use class as the key. * @@ -12,33 +15,35 @@ import com.alibaba.excel.util.MapUtils; */ public class ConverterKeyBuild { - private static final Map BOXING_MAP = MapUtils.newHashMap(); + private static final Map, Class> BOXING_MAP = MapUtils.newHashMap(); static { - BOXING_MAP.put(int.class.getName(), Integer.class.getName()); - BOXING_MAP.put(byte.class.getName(), Byte.class.getName()); - BOXING_MAP.put(long.class.getName(), Long.class.getName()); - BOXING_MAP.put(double.class.getName(), Double.class.getName()); - BOXING_MAP.put(float.class.getName(), Float.class.getName()); - BOXING_MAP.put(char.class.getName(), Character.class.getName()); - BOXING_MAP.put(short.class.getName(), Short.class.getName()); - BOXING_MAP.put(boolean.class.getName(), Boolean.class.getName()); + BOXING_MAP.put(int.class, Integer.class); + BOXING_MAP.put(byte.class, Byte.class); + BOXING_MAP.put(long.class, Long.class); + BOXING_MAP.put(double.class, Double.class); + BOXING_MAP.put(float.class, Float.class); + BOXING_MAP.put(char.class, Character.class); + BOXING_MAP.put(short.class, Short.class); + BOXING_MAP.put(boolean.class, Boolean.class); } - public static String buildKey(Class clazz) { - String className = clazz.getName(); - String boxingClassName = BOXING_MAP.get(clazz.getName()); - if (boxingClassName == null) { - return className; + public static ConverterKey buildKey(Class clazz) { + Class boxingClass = BOXING_MAP.get(clazz); + if (boxingClass != null) { + return new ConverterKey(boxingClass, null); } - return boxingClassName; + return new ConverterKey(clazz, null); } - public static String buildKey(Class clazz, CellDataTypeEnum cellDataTypeEnum) { - String key = buildKey(clazz); - if (cellDataTypeEnum == null) { - return key; - } - return key + "-" + cellDataTypeEnum; + public static ConverterKey buildKey(Class clazz, CellDataTypeEnum cellDataTypeEnum) { + return new ConverterKey(clazz, cellDataTypeEnum); + } + + @Data + @AllArgsConstructor + public static class ConverterKey { + private Class clazz; + private CellDataTypeEnum cellDataTypeEnum; } } diff --git a/src/main/java/com/alibaba/excel/converters/DefaultConverterLoader.java b/src/main/java/com/alibaba/excel/converters/DefaultConverterLoader.java index fda84b84..ac2dd8dc 100644 --- a/src/main/java/com/alibaba/excel/converters/DefaultConverterLoader.java +++ b/src/main/java/com/alibaba/excel/converters/DefaultConverterLoader.java @@ -2,6 +2,7 @@ package com.alibaba.excel.converters; import java.util.Map; +import com.alibaba.excel.converters.ConverterKeyBuild.ConverterKey; import com.alibaba.excel.converters.bigdecimal.BigDecimalBooleanConverter; import com.alibaba.excel.converters.bigdecimal.BigDecimalNumberConverter; import com.alibaba.excel.converters.bigdecimal.BigDecimalStringConverter; @@ -52,8 +53,8 @@ import com.alibaba.excel.util.MapUtils; * @author Jiaju Zhuang */ public class DefaultConverterLoader { - private static Map> defaultWriteConverter; - private static Map> allConverter; + private static Map> defaultWriteConverter; + private static Map> allConverter; static { initDefaultWriteConverter(); @@ -153,7 +154,7 @@ public class DefaultConverterLoader { * * @return */ - public static Map> loadDefaultWriteConverter() { + public static Map> loadDefaultWriteConverter() { return defaultWriteConverter; } @@ -171,7 +172,7 @@ public class DefaultConverterLoader { * * @return */ - public static Map> loadDefaultReadConverter() { + public static Map> loadDefaultReadConverter() { return loadAllConverter(); } @@ -180,7 +181,7 @@ public class DefaultConverterLoader { * * @return */ - public static Map> loadAllConverter() { + public static Map> loadAllConverter() { return allConverter; } diff --git a/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java b/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java index 1cb9c934..1e56a200 100644 --- a/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java +++ b/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java @@ -32,7 +32,7 @@ public class ExcelDataConvertException extends RuntimeException { */ private ExcelContentProperty excelContentProperty; - public ExcelDataConvertException(Integer rowIndex, Integer columnIndex, CellData cellData, + public ExcelDataConvertException(Integer rowIndex, Integer columnIndex, CellData cellData, ExcelContentProperty excelContentProperty, String message) { super(message); this.rowIndex = rowIndex; @@ -41,7 +41,7 @@ public class ExcelDataConvertException extends RuntimeException { this.excelContentProperty = excelContentProperty; } - public ExcelDataConvertException(Integer rowIndex, Integer columnIndex, CellData cellData, + public ExcelDataConvertException(Integer rowIndex, Integer columnIndex, CellData cellData, ExcelContentProperty excelContentProperty, String message, Throwable cause) { super(message, cause); this.rowIndex = rowIndex; diff --git a/src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java b/src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java new file mode 100644 index 00000000..9f9a2e4a --- /dev/null +++ b/src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java @@ -0,0 +1,32 @@ +package com.alibaba.excel.exception; + +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; + +import lombok.Data; + +/** + * Data convert exception + * + * @author Jiaju Zhuang + */ +@Data +public class ExcelWriteDataConvertException extends ExcelDataConvertException { + /** + * handler. + */ + private CellWriteHandlerContext cellWriteHandlerContext; + + public ExcelWriteDataConvertException(CellWriteHandlerContext cellWriteHandlerContext, String message) { + super(cellWriteHandlerContext.getRowIndex(), cellWriteHandlerContext.getColumnIndex(), + cellWriteHandlerContext.getFirstCellData(), cellWriteHandlerContext.getExcelContentProperty(), message); + this.cellWriteHandlerContext = cellWriteHandlerContext; + } + + public ExcelWriteDataConvertException(CellWriteHandlerContext cellWriteHandlerContext, String message, + Throwable cause) { + super(cellWriteHandlerContext.getRowIndex(), cellWriteHandlerContext.getColumnIndex(), + cellWriteHandlerContext.getFirstCellData(), cellWriteHandlerContext.getExcelContentProperty(), message, + cause); + this.cellWriteHandlerContext = cellWriteHandlerContext; + } +} diff --git a/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java b/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java index 735a0623..828f38e7 100644 --- a/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java +++ b/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ConverterKeyBuild.ConverterKey; import lombok.Data; import lombok.NoArgsConstructor; @@ -38,7 +39,7 @@ public abstract class AbstractHolder implements ConfigurationHolder { *

* Write key: */ - private Map> converterMap; + private Map> converterMap; public AbstractHolder(BasicParameter basicParameter, AbstractHolder prentAbstractHolder) { this.newInitialization = Boolean.TRUE; @@ -81,7 +82,7 @@ public abstract class AbstractHolder implements ConfigurationHolder { } @Override - public Map> converterMap() { + public Map> converterMap() { return getConverterMap(); } diff --git a/src/main/java/com/alibaba/excel/metadata/ConfigurationHolder.java b/src/main/java/com/alibaba/excel/metadata/ConfigurationHolder.java index ee4d7edf..e842466d 100644 --- a/src/main/java/com/alibaba/excel/metadata/ConfigurationHolder.java +++ b/src/main/java/com/alibaba/excel/metadata/ConfigurationHolder.java @@ -3,9 +3,9 @@ package com.alibaba.excel.metadata; import java.util.Map; import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ConverterKeyBuild.ConverterKey; /** - * * Get the corresponding holder * * @author Jiaju Zhuang @@ -13,7 +13,6 @@ import com.alibaba.excel.converters.Converter; public interface ConfigurationHolder extends Holder { /** - * * Record whether it's new or from cache * * @return Record whether it's new or from cache @@ -32,5 +31,5 @@ public interface ConfigurationHolder extends Holder { * * @return Converter */ - Map> converterMap(); + Map> converterMap(); } diff --git a/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java b/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java index 5a3487bf..a988703a 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java @@ -8,7 +8,6 @@ import java.util.List; import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.util.ListUtils; -import com.alibaba.excel.write.metadata.fill.AnalysisCell; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import lombok.Data; @@ -56,10 +55,6 @@ public class WriteCellData extends CellData { */ private CellStyle originCellStyle; - /** - * Only in the case of the fill is not null - */ - private AnalysisCell analysisCell; public WriteCellData(String stringValue) { this(CellDataTypeEnum.STRING, stringValue); diff --git a/src/main/java/com/alibaba/excel/util/ConverterUtils.java b/src/main/java/com/alibaba/excel/util/ConverterUtils.java index b666be6e..2a30c57c 100644 --- a/src/main/java/com/alibaba/excel/util/ConverterUtils.java +++ b/src/main/java/com/alibaba/excel/util/ConverterUtils.java @@ -8,6 +8,7 @@ import java.util.Map; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.converters.ConverterKeyBuild; +import com.alibaba.excel.converters.ConverterKeyBuild.ConverterKey; import com.alibaba.excel.converters.NullableObjectConverter; import com.alibaba.excel.converters.ReadConverterContext; import com.alibaba.excel.enums.CellDataTypeEnum; @@ -80,7 +81,7 @@ public class ConverterUtils { * @return */ public static Object convertToJavaObject(ReadCellData cellData, Field field, - ExcelContentProperty contentProperty, Map> converterMap, AnalysisContext context, + ExcelContentProperty contentProperty, Map> converterMap, AnalysisContext context, Integer rowIndex, Integer columnIndex) { Class clazz; if (field == null) { @@ -126,7 +127,7 @@ public class ConverterUtils { * @return */ private static Object doConvertToJavaObject(ReadCellData cellData, Class clazz, - ExcelContentProperty contentProperty, Map> converterMap, AnalysisContext context, + ExcelContentProperty contentProperty, Map> converterMap, AnalysisContext context, Integer rowIndex, Integer columnIndex) { Converter converter = null; if (contentProperty != null) { diff --git a/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java b/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java index 1ea362b0..cb04b956 100644 --- a/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java +++ b/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java @@ -5,7 +5,6 @@ import java.util.Map; import com.alibaba.excel.context.WriteContext; import com.alibaba.excel.metadata.Head; -import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.write.handler.CellWriteHandler; import com.alibaba.excel.write.handler.RowWriteHandler; @@ -18,7 +17,6 @@ import com.alibaba.excel.write.handler.context.SheetWriteHandlerContext; import com.alibaba.excel.write.handler.context.WorkbookWriteHandlerContext; import org.apache.commons.collections4.CollectionUtils; -import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; /** @@ -30,222 +28,205 @@ public class WriteHandlerUtils { private WriteHandlerUtils() {} - public static void beforeWorkbookCreate(WriteContext writeContext) { - beforeWorkbookCreate(writeContext, false); + public static WorkbookWriteHandlerContext createWorkbookWriteHandlerContext(WriteContext writeContext) { + return createWorkbookWriteHandlerContext(writeContext, false); } - public static void beforeWorkbookCreate(WriteContext writeContext, boolean runOwn) { + public static WorkbookWriteHandlerContext createWorkbookWriteHandlerContext(WriteContext writeContext, + boolean runOwn) { List handlerList = getHandlerList(writeContext, WorkbookWriteHandler.class, runOwn); - if (handlerList == null || handlerList.isEmpty()) { - return; + WorkbookWriteHandlerContext context = new WorkbookWriteHandlerContext(writeContext, null, null, null); + if (runOwn) { + context.setOwnHandlerList(handlerList); + } else { + context.setHandlerList(handlerList); + } + writeContext.writeWorkbookHolder().setWorkbookWriteHandlerContext(context); + return context; + } + + public static void beforeWorkbookCreate(WorkbookWriteHandlerContext context) { + beforeWorkbookCreate(context, false); + } + + public static void beforeWorkbookCreate(WorkbookWriteHandlerContext context, boolean runOwn) { + List handlerList; + if (runOwn) { + handlerList = context.getOwnHandlerList(); + } else { + handlerList = context.getHandlerList(); } - WorkbookWriteHandlerContext context = new WorkbookWriteHandlerContext(writeContext, null); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof WorkbookWriteHandler) { + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((WorkbookWriteHandler)writeHandler).beforeWorkbookCreate(context); } } } - public static void afterWorkbookCreate(WriteContext writeContext) { - afterWorkbookCreate(writeContext, false); + public static void afterWorkbookCreate(WorkbookWriteHandlerContext context) { + afterWorkbookCreate(context, false); } - public static void afterWorkbookCreate(WriteContext writeContext, boolean runOwn) { - List handlerList = getHandlerList(writeContext, WorkbookWriteHandler.class, runOwn); - if (handlerList == null || handlerList.isEmpty()) { - return; + public static void afterWorkbookCreate(WorkbookWriteHandlerContext context, boolean runOwn) { + List handlerList; + if (runOwn) { + handlerList = context.getOwnHandlerList(); + } else { + handlerList = context.getHandlerList(); } - WorkbookWriteHandlerContext context = new WorkbookWriteHandlerContext(writeContext, - writeContext.writeWorkbookHolder()); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof WorkbookWriteHandler) { + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((WorkbookWriteHandler)writeHandler).afterWorkbookCreate(context); } } } - public static void afterWorkbookDispose(WriteContext writeContext) { - List handlerList = - writeContext.currentWriteHolder().writeHandlerMap().get(WorkbookWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - WorkbookWriteHandlerContext context = new WorkbookWriteHandlerContext(writeContext, - writeContext.writeWorkbookHolder()); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof WorkbookWriteHandler) { + public static void afterWorkbookDispose(WorkbookWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((WorkbookWriteHandler)writeHandler).afterWorkbookDispose(context); } } } - public static void beforeSheetCreate(WriteContext writeContext) { - beforeSheetCreate(writeContext, false); + public static SheetWriteHandlerContext createSheetWriteHandlerContext(WriteContext writeContext) { + return createSheetWriteHandlerContext(writeContext, false); } - public static void beforeSheetCreate(WriteContext writeContext, boolean runOwn) { + public static SheetWriteHandlerContext createSheetWriteHandlerContext(WriteContext writeContext, boolean runOwn) { List handlerList = getHandlerList(writeContext, SheetWriteHandler.class, runOwn); - if (handlerList == null || handlerList.isEmpty()) { - return; - } SheetWriteHandlerContext context = new SheetWriteHandlerContext(writeContext, - writeContext.writeWorkbookHolder(), writeContext.writeSheetHolder()); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof SheetWriteHandler) { + writeContext.writeWorkbookHolder(), writeContext.writeSheetHolder(), null, null); + if (runOwn) { + context.setOwnHandlerList(handlerList); + } else { + context.setHandlerList(handlerList); + } + return context; + } + + public static void beforeSheetCreate(SheetWriteHandlerContext context) { + beforeSheetCreate(context, false); + } + + public static void beforeSheetCreate(SheetWriteHandlerContext context, boolean runOwn) { + List handlerList; + if (runOwn) { + handlerList = context.getOwnHandlerList(); + } else { + handlerList = context.getHandlerList(); + } + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((SheetWriteHandler)writeHandler).beforeSheetCreate(context); } } } - public static void afterSheetCreate(WriteContext writeContext) { - afterSheetCreate(writeContext, false); + public static void afterSheetCreate(SheetWriteHandlerContext context) { + afterSheetCreate(context, false); } - public static void afterSheetCreate(WriteContext writeContext, boolean runOwn) { - List handlerList = getHandlerList(writeContext, SheetWriteHandler.class, runOwn); - if (handlerList == null || handlerList.isEmpty()) { - return; + public static void afterSheetCreate(SheetWriteHandlerContext context, boolean runOwn) { + List handlerList; + if (runOwn) { + handlerList = context.getOwnHandlerList(); + } else { + handlerList = context.getHandlerList(); } - SheetWriteHandlerContext context = new SheetWriteHandlerContext(writeContext, - writeContext.writeWorkbookHolder(), writeContext.writeSheetHolder()); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof SheetWriteHandler) { + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((SheetWriteHandler)writeHandler).afterSheetCreate(context); } } } - public static void beforeCellCreate(WriteContext writeContext, Row row, Head head, Integer columnIndex, - Integer relativeRowIndex, Boolean isHead, ExcelContentProperty excelContentProperty) { - List handlerList = - writeContext.currentWriteHolder().writeHandlerMap().get(CellWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - CellWriteHandlerContext context = new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, null, columnIndex, relativeRowIndex, - head, null, null, isHead, excelContentProperty); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof CellWriteHandler) { + public static CellWriteHandlerContext createCellWriteHandlerContext(WriteContext writeContext, Row row, + Integer rowIndex, Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, + ExcelContentProperty excelContentProperty) { + List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get( + CellWriteHandler.class); + return new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, rowIndex, null, columnIndex, + relativeRowIndex, head, null, null, isHead, excelContentProperty, handlerList); + } + + public static void beforeCellCreate(CellWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((CellWriteHandler)writeHandler).beforeCellCreate(context); } } } - public static void afterCellCreate(WriteContext writeContext, Cell cell, Row row, Head head, - Integer columnIndex, Integer relativeRowIndex, Boolean isHead, ExcelContentProperty excelContentProperty) { - List handlerList = - writeContext.currentWriteHolder().writeHandlerMap().get(CellWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - CellWriteHandlerContext context = new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, cell, columnIndex, relativeRowIndex, - head, null, null, isHead, excelContentProperty); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof CellWriteHandler) { + public static void afterCellCreate(CellWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((CellWriteHandler)writeHandler).afterCellCreate(context); } } } - public static void afterCellDataConverted(WriteContext writeContext, WriteCellData cellData, Cell cell, Row row, - Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, - ExcelContentProperty excelContentProperty) { - List handlerList = - writeContext.currentWriteHolder().writeHandlerMap().get(CellWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - List> cellDataList = cellData == null ? null : ListUtils.newArrayList(cellData); - CellWriteHandlerContext context = new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, cell, - columnIndex, relativeRowIndex, head, cellDataList, cellData, isHead, excelContentProperty); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof CellWriteHandler) { + public static void afterCellDataConverted(CellWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((CellWriteHandler)writeHandler).afterCellDataConverted(context); } } } - public static void afterCellDispose(WriteContext writeContext, WriteCellData cellData, Cell cell, Row row, - Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, - ExcelContentProperty excelContentProperty) { - List> cellDataList = cellData == null ? null : ListUtils.newArrayList(cellData); - afterCellDispose(writeContext, cellDataList, cell, row, head, columnIndex, relativeRowIndex, isHead, - excelContentProperty); - } - - public static void afterCellDispose(WriteContext writeContext, List> cellDataList, Cell cell, - Row row, Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, - ExcelContentProperty excelContentProperty) { - List handlerList = - writeContext.currentWriteHolder().writeHandlerMap().get(CellWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - WriteCellData cellData = null; - if (CollectionUtils.isNotEmpty(cellDataList)) { - cellData = cellDataList.get(0); - } - CellWriteHandlerContext context = new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, cell, columnIndex, relativeRowIndex, - head, cellDataList, cellData, isHead, excelContentProperty); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof CellWriteHandler) { + public static void afterCellDispose(CellWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((CellWriteHandler)writeHandler).afterCellDispose(context); } } } - public static void beforeRowCreate(WriteContext writeContext, Integer rowIndex, Integer relativeRowIndex, - Boolean isHead) { - List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(RowWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - RowWriteHandlerContext context = new RowWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, null, relativeRowIndex, isHead); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof RowWriteHandler) { + public static RowWriteHandlerContext createRowWriteHandlerContext(WriteContext writeContext, Integer rowIndex, + Integer relativeRowIndex, Boolean isHead) { + List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get( + RowWriteHandler.class); + return new RowWriteHandlerContext(writeContext, + writeContext.writeWorkbookHolder(), + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, null, relativeRowIndex, + isHead, handlerList); + } + + public static void beforeRowCreate(RowWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((RowWriteHandler)writeHandler).beforeRowCreate(context); } } } - public static void afterRowCreate(WriteContext writeContext, Row row, Integer rowIndex, Integer relativeRowIndex, - Boolean isHead) { - List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(RowWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - RowWriteHandlerContext context = new RowWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, row, relativeRowIndex, - isHead); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof RowWriteHandler) { + public static void afterRowCreate(RowWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((RowWriteHandler)writeHandler).afterRowCreate(context); } } } - public static void afterRowDispose(WriteContext writeContext, Row row, Integer rowIndex, Integer relativeRowIndex, - Boolean isHead) { - List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get(RowWriteHandler.class); - if (handlerList == null || handlerList.isEmpty()) { - return; - } - RowWriteHandlerContext context = new RowWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, row, relativeRowIndex, isHead); - for (WriteHandler writeHandler : handlerList) { - if (writeHandler instanceof RowWriteHandler) { + public static void afterRowDispose(RowWriteHandlerContext context) { + List handlerList = context.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (WriteHandler writeHandler : handlerList) { ((RowWriteHandler)writeHandler).afterRowDispose(context); } } } - private static List getHandlerList(WriteContext writeContext, Class clazz, + private static List getHandlerList(WriteContext writeContext, Class clazz, boolean runOwn) { Map, List> writeHandlerMap; if (runOwn) { diff --git a/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java b/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java index 7c94e178..9d10ca1e 100644 --- a/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java @@ -8,8 +8,7 @@ import com.alibaba.excel.converters.ConverterKeyBuild; import com.alibaba.excel.converters.NullableObjectConverter; import com.alibaba.excel.converters.WriteConverterContext; import com.alibaba.excel.enums.CellDataTypeEnum; -import com.alibaba.excel.exception.ExcelDataConvertException; -import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.exception.ExcelWriteDataConvertException; import com.alibaba.excel.metadata.data.CommentData; import com.alibaba.excel.metadata.data.FormulaData; import com.alibaba.excel.metadata.data.HyperlinkData; @@ -19,10 +18,11 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.util.DateUtils; import com.alibaba.excel.util.FileTypeUtils; +import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.StyleUtil; import com.alibaba.excel.util.WorkBookUtil; import com.alibaba.excel.util.WriteHandlerUtils; -import com.alibaba.excel.write.metadata.holder.WriteHolder; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.hssf.usermodel.HSSFClientAnchor; @@ -32,8 +32,8 @@ import org.apache.poi.ss.usermodel.Comment; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.ss.usermodel.Drawing; import org.apache.poi.ss.usermodel.Hyperlink; -import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFClientAnchor; /** @@ -48,124 +48,140 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { this.writeContext = writeContext; } - protected WriteCellData converterAndSet(WriteHolder currentWriteHolder, Class clazz, - CellDataTypeEnum targetType, Cell cell, Row row, Object value, ExcelContentProperty excelContentProperty, - Head head, Integer relativeRowIndex, int rowIndex, int columnIndex) { - boolean needTrim = value != null && (value instanceof String && currentWriteHolder.globalConfiguration() - .getAutoTrim()); - if (needTrim) { - value = ((String)value).trim(); - } - WriteCellData cellData = convert(currentWriteHolder, clazz, targetType, cell, value, excelContentProperty); - WriteHandlerUtils.afterCellDataConverted(writeContext, cellData, cell, row, head, columnIndex, relativeRowIndex, - Boolean.FALSE, excelContentProperty); + /** + * Transform the data and then to set into the cell + * + * @param cellWriteHandlerContext context + * @return + */ + protected void converterAndSet(CellWriteHandlerContext cellWriteHandlerContext) { + + WriteCellData cellData = convert(cellWriteHandlerContext); + cellWriteHandlerContext.setCellDataList(ListUtils.newArrayList(cellData)); + cellWriteHandlerContext.setFirstCellData(cellData); + + WriteHandlerUtils.afterCellDataConverted(cellWriteHandlerContext); // Fill in picture information - fillImage(cell, cellData.getImageDataList()); + fillImage(cellWriteHandlerContext, cellData.getImageDataList()); // Fill in comment information - fillComment(cell, cellData.getCommentData()); + fillComment(cellWriteHandlerContext, cellData.getCommentData()); // Fill in hyper link information - fillHyperLink(cell, cellData.getHyperlinkData()); + fillHyperLink(cellWriteHandlerContext, cellData.getHyperlinkData()); // Fill in formula information - fillFormula(cell, cellData.getFormulaData()); + fillFormula(cellWriteHandlerContext, cellData.getFormulaData()); // Fill index - cellData.setRowIndex(rowIndex); - cellData.setColumnIndex(columnIndex); + cellData.setRowIndex(cellWriteHandlerContext.getRowIndex()); + cellData.setColumnIndex(cellWriteHandlerContext.getColumnIndex()); if (cellData.getType() == null) { cellData.setType(CellDataTypeEnum.EMPTY); } + Cell cell = cellWriteHandlerContext.getCell(); switch (cellData.getType()) { case STRING: cell.setCellValue(cellData.getStringValue()); - return cellData; + return; case BOOLEAN: cell.setCellValue(cellData.getBooleanValue()); - return cellData; + return; case NUMBER: cell.setCellValue(cellData.getNumberValue().doubleValue()); - return cellData; + return; case DATE: cell.setCellValue(cellData.getDateValue()); - return cellData; + return; case RICH_TEXT_STRING: cell.setCellValue(StyleUtil .buildRichTextString(writeContext.writeWorkbookHolder(), cellData.getRichTextStringDataValue())); - return cellData; + return; case EMPTY: - return cellData; + return; default: - throw new ExcelDataConvertException(cell.getRow().getRowNum(), cell.getColumnIndex(), cellData, - excelContentProperty, "Not supported data:" + value + " return type:" + cell.getCellType() - + "at row:" + cell.getRow().getRowNum()); + throw new ExcelWriteDataConvertException(cellWriteHandlerContext, + "Not supported data:" + cellWriteHandlerContext.getOriginalValue() + " return type:" + + cellData.getType() + + "at row:" + cellWriteHandlerContext.getRowIndex()); } } - private void fillFormula(Cell cell, FormulaData formulaData) { + private void fillFormula(CellWriteHandlerContext cellWriteHandlerContext, FormulaData formulaData) { if (formulaData == null) { return; } + Cell cell = cellWriteHandlerContext.getCell(); if (formulaData.getFormulaValue() != null) { cell.setCellFormula(formulaData.getFormulaValue()); } } - private void fillHyperLink(Cell cell, HyperlinkData hyperlinkData) { + private void fillHyperLink(CellWriteHandlerContext cellWriteHandlerContext, HyperlinkData hyperlinkData) { if (hyperlinkData == null) { return; } - CreationHelper helper = cell.getSheet().getWorkbook().getCreationHelper(); + Integer rowIndex = cellWriteHandlerContext.getRowIndex(); + Integer columnIndex = cellWriteHandlerContext.getColumnIndex(); + Workbook workbook = cellWriteHandlerContext.getWriteWorkbookHolder().getWorkbook(); + Cell cell = cellWriteHandlerContext.getCell(); + + CreationHelper helper = workbook.getCreationHelper(); Hyperlink hyperlink = helper.createHyperlink(StyleUtil.getHyperlinkType(hyperlinkData.getHyperlinkType())); hyperlink.setAddress(hyperlinkData.getAddress()); - hyperlink.setFirstRow(StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), hyperlinkData.getFirstRowIndex(), + hyperlink.setFirstRow(StyleUtil.getCellCoordinate(rowIndex, hyperlinkData.getFirstRowIndex(), hyperlinkData.getRelativeFirstRowIndex())); - hyperlink.setFirstColumn(StyleUtil.getCellCoordinate(cell.getColumnIndex(), hyperlinkData.getFirstColumnIndex(), + hyperlink.setFirstColumn(StyleUtil.getCellCoordinate(columnIndex, hyperlinkData.getFirstColumnIndex(), hyperlinkData.getRelativeFirstColumnIndex())); - hyperlink.setLastRow(StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), hyperlinkData.getLastRowIndex(), + hyperlink.setLastRow(StyleUtil.getCellCoordinate(rowIndex, hyperlinkData.getLastRowIndex(), hyperlinkData.getRelativeLastRowIndex())); - hyperlink.setLastColumn(StyleUtil.getCellCoordinate(cell.getColumnIndex(), hyperlinkData.getLastColumnIndex(), + hyperlink.setLastColumn(StyleUtil.getCellCoordinate(columnIndex, hyperlinkData.getLastColumnIndex(), hyperlinkData.getRelativeLastColumnIndex())); cell.setHyperlink(hyperlink); } - private void fillComment(Cell cell, CommentData commentData) { + private void fillComment(CellWriteHandlerContext cellWriteHandlerContext, CommentData commentData) { if (commentData == null) { return; } ClientAnchor anchor; + Integer rowIndex = cellWriteHandlerContext.getRowIndex(); + Integer columnIndex = cellWriteHandlerContext.getColumnIndex(); + Sheet sheet = cellWriteHandlerContext.getWriteSheetHolder().getSheet(); + Cell cell = cellWriteHandlerContext.getCell(); + if (writeContext.writeWorkbookHolder().getExcelType() == ExcelTypeEnum.XLSX) { anchor = new XSSFClientAnchor(StyleUtil.getCoordinate(commentData.getLeft()), StyleUtil.getCoordinate(commentData.getTop()), StyleUtil.getCoordinate(commentData.getRight()), StyleUtil.getCoordinate(commentData.getBottom()), - StyleUtil.getCellCoordinate(cell.getColumnIndex(), commentData.getFirstColumnIndex(), + StyleUtil.getCellCoordinate(columnIndex, commentData.getFirstColumnIndex(), commentData.getRelativeFirstColumnIndex()), - StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), commentData.getFirstRowIndex(), + StyleUtil.getCellCoordinate(rowIndex, commentData.getFirstRowIndex(), commentData.getRelativeFirstRowIndex()), - StyleUtil.getCellCoordinate(cell.getColumnIndex(), commentData.getLastColumnIndex(), + StyleUtil.getCellCoordinate(columnIndex, commentData.getLastColumnIndex(), commentData.getRelativeLastColumnIndex()) + 1, - StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), commentData.getLastRowIndex(), + StyleUtil.getCellCoordinate(rowIndex, commentData.getLastRowIndex(), commentData.getRelativeLastRowIndex()) + 1); } else { anchor = new HSSFClientAnchor(StyleUtil.getCoordinate(commentData.getLeft()), StyleUtil.getCoordinate(commentData.getTop()), StyleUtil.getCoordinate(commentData.getRight()), StyleUtil.getCoordinate(commentData.getBottom()), - (short)StyleUtil.getCellCoordinate(cell.getColumnIndex(), commentData.getFirstColumnIndex(), + (short)StyleUtil.getCellCoordinate(columnIndex, commentData.getFirstColumnIndex(), commentData.getRelativeFirstColumnIndex()), - StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), commentData.getFirstRowIndex(), + StyleUtil.getCellCoordinate(rowIndex, commentData.getFirstRowIndex(), commentData.getRelativeFirstRowIndex()), - (short)(StyleUtil.getCellCoordinate(cell.getColumnIndex(), commentData.getLastColumnIndex(), + (short)(StyleUtil.getCellCoordinate(columnIndex, commentData.getLastColumnIndex(), commentData.getRelativeLastColumnIndex()) + 1), - StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), commentData.getLastRowIndex(), + StyleUtil.getCellCoordinate(rowIndex, commentData.getLastRowIndex(), commentData.getRelativeLastRowIndex()) + 1); } - Comment comment = cell.getSheet().createDrawingPatriarch().createCellComment(anchor); + + Comment comment = sheet.createDrawingPatriarch().createCellComment(anchor); if (commentData.getRichTextStringData() != null) { comment.setString( StyleUtil.buildRichTextString(writeContext.writeWorkbookHolder(), commentData.getRichTextStringData())); @@ -176,18 +192,22 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { cell.setCellComment(comment); } - protected void fillImage(Cell cell, List imageDataList) { + protected void fillImage(CellWriteHandlerContext cellWriteHandlerContext, List imageDataList) { if (CollectionUtils.isEmpty(imageDataList)) { return; } - Sheet sheet = cell.getSheet(); + Integer rowIndex = cellWriteHandlerContext.getRowIndex(); + Integer columnIndex = cellWriteHandlerContext.getColumnIndex(); + Sheet sheet = cellWriteHandlerContext.getWriteSheetHolder().getSheet(); + Workbook workbook = cellWriteHandlerContext.getWriteWorkbookHolder().getWorkbook(); + Drawing drawing = sheet.getDrawingPatriarch(); if (drawing == null) { drawing = sheet.createDrawingPatriarch(); } CreationHelper helper = sheet.getWorkbook().getCreationHelper(); for (ImageData imageData : imageDataList) { - int index = sheet.getWorkbook().addPicture(imageData.getImage(), + int index = workbook.addPicture(imageData.getImage(), FileTypeUtils.getImageTypeFormat(imageData.getImage())); ClientAnchor anchor = helper.createClientAnchor(); if (imageData.getTop() != null) { @@ -202,13 +222,13 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { if (imageData.getLeft() != null) { anchor.setDx1(StyleUtil.getCoordinate(imageData.getLeft())); } - anchor.setRow1(StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), imageData.getFirstRowIndex(), + anchor.setRow1(StyleUtil.getCellCoordinate(rowIndex, imageData.getFirstRowIndex(), imageData.getRelativeFirstRowIndex())); - anchor.setCol1(StyleUtil.getCellCoordinate(cell.getColumnIndex(), imageData.getFirstColumnIndex(), + anchor.setCol1(StyleUtil.getCellCoordinate(columnIndex, imageData.getFirstColumnIndex(), imageData.getRelativeFirstColumnIndex())); - anchor.setRow2(StyleUtil.getCellCoordinate(cell.getRow().getRowNum(), imageData.getLastRowIndex(), + anchor.setRow2(StyleUtil.getCellCoordinate(rowIndex, imageData.getLastRowIndex(), imageData.getRelativeLastRowIndex()) + 1); - anchor.setCol2(StyleUtil.getCellCoordinate(cell.getColumnIndex(), imageData.getLastColumnIndex(), + anchor.setCol2(StyleUtil.getCellCoordinate(columnIndex, imageData.getLastColumnIndex(), imageData.getRelativeLastColumnIndex()) + 1); if (imageData.getAnchorType() != null) { anchor.setAnchorType(imageData.getAnchorType().getValue()); @@ -217,17 +237,16 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { } } - protected WriteCellData convert(WriteHolder currentWriteHolder, Class clazz, CellDataTypeEnum targetType, - Cell cell, Object value, ExcelContentProperty excelContentProperty) { + protected WriteCellData convert(CellWriteHandlerContext cellWriteHandlerContext) { // This means that the user has defined the data. - if (clazz == WriteCellData.class) { - if (value == null) { + if (cellWriteHandlerContext.getOriginalFieldClass() == WriteCellData.class) { + if (cellWriteHandlerContext.getOriginalValue() == null) { return new WriteCellData<>(CellDataTypeEnum.EMPTY); } - WriteCellData cellDataValue = (WriteCellData)value; + WriteCellData cellDataValue = (WriteCellData)cellWriteHandlerContext.getOriginalValue(); if (cellDataValue.getType() != null) { // Configuration information may not be read here - fillProperty(cellDataValue, excelContentProperty); + fillProperty(cellDataValue, cellWriteHandlerContext.getExcelContentProperty()); return cellDataValue; } else { @@ -236,8 +255,7 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { return cellDataValue; } } - WriteCellData cellDataReturn = doConvert(currentWriteHolder, cellDataValue.getData().getClass(), - targetType, cell, cellDataValue.getData(), excelContentProperty); + WriteCellData cellDataReturn = doConvert(cellWriteHandlerContext); if (cellDataValue.getImageDataList() != null) { cellDataReturn.setImageDataList(cellDataValue.getImageDataList()); @@ -257,7 +275,7 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { } return cellDataReturn; } - return doConvert(currentWriteHolder, clazz, targetType, cell, value, excelContentProperty); + return doConvert(cellWriteHandlerContext); } private void fillProperty(WriteCellData cellDataValue, ExcelContentProperty excelContentProperty) { @@ -281,8 +299,9 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { } } - private WriteCellData doConvert(WriteHolder currentWriteHolder, Class clazz, CellDataTypeEnum targetType, - Cell cell, Object value, ExcelContentProperty excelContentProperty) { + private WriteCellData doConvert(CellWriteHandlerContext cellWriteHandlerContext) { + ExcelContentProperty excelContentProperty = cellWriteHandlerContext.getExcelContentProperty(); + Converter converter = null; if (excelContentProperty != null) { converter = excelContentProperty.getConverter(); @@ -290,31 +309,34 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { if (converter == null) { // csv is converted to string by default if (writeContext.writeWorkbookHolder().getExcelType() == ExcelTypeEnum.CSV) { - targetType = CellDataTypeEnum.STRING; + cellWriteHandlerContext.setTargetCellDataType(CellDataTypeEnum.STRING); } - converter = currentWriteHolder.converterMap().get(ConverterKeyBuild.buildKey(clazz, targetType)); + converter = writeContext.currentWriteHolder().converterMap().get( + ConverterKeyBuild.buildKey(cellWriteHandlerContext.getOriginalFieldClass(), + cellWriteHandlerContext.getTargetCellDataType())); } - if (value == null && !(converter instanceof NullableObjectConverter)) { + if (cellWriteHandlerContext.getOriginalValue() == null && !(converter instanceof NullableObjectConverter)) { return new WriteCellData<>(CellDataTypeEnum.EMPTY); } if (converter == null) { - throw new ExcelDataConvertException(cell.getRow().getRowNum(), cell.getColumnIndex(), - new WriteCellData<>(CellDataTypeEnum.EMPTY), excelContentProperty, - "Can not find 'Converter' support class " + clazz.getSimpleName() + "."); + throw new ExcelWriteDataConvertException(cellWriteHandlerContext, + "Can not find 'Converter' support class " + cellWriteHandlerContext.getOriginalFieldClass() + .getSimpleName() + "."); } WriteCellData cellData; try { cellData = ((Converter)converter).convertToExcelData( - new WriteConverterContext<>(value, excelContentProperty, writeContext)); + new WriteConverterContext<>(cellWriteHandlerContext.getOriginalValue(), excelContentProperty, + writeContext)); } catch (Exception e) { - throw new ExcelDataConvertException(cell.getRow().getRowNum(), cell.getColumnIndex(), - new WriteCellData<>(CellDataTypeEnum.EMPTY), excelContentProperty, - "Convert data:" + value + " error, at row:" + cell.getRow().getRowNum(), e); + throw new ExcelWriteDataConvertException(cellWriteHandlerContext, + "Convert data:" + cellWriteHandlerContext.getOriginalValue() + " error, at row:" + + cellWriteHandlerContext.getRowIndex(), e); } if (cellData == null || cellData.getType() == null) { - throw new ExcelDataConvertException(cell.getRow().getRowNum(), cell.getColumnIndex(), - new WriteCellData<>(CellDataTypeEnum.EMPTY), excelContentProperty, - "Convert data:" + value + " return null, at row:" + cell.getRow().getRowNum()); + throw new ExcelWriteDataConvertException(cellWriteHandlerContext, + "Convert data:" + cellWriteHandlerContext.getOriginalValue() + " return null, at row:" + + cellWriteHandlerContext.getRowIndex()); } return cellData; } diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java index db0f7247..ffb8844c 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java @@ -11,13 +11,14 @@ import java.util.TreeMap; import com.alibaba.excel.context.WriteContext; import com.alibaba.excel.enums.HeadKindEnum; import com.alibaba.excel.metadata.Head; -import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.util.BeanMapUtils; import com.alibaba.excel.util.ClassUtils; import com.alibaba.excel.util.FieldUtils; import com.alibaba.excel.util.WorkBookUtil; import com.alibaba.excel.util.WriteHandlerUtils; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.handler.context.RowWriteHandlerContext; import com.alibaba.excel.write.metadata.CollectionRowData; import com.alibaba.excel.write.metadata.MapRowData; import com.alibaba.excel.write.metadata.RowData; @@ -64,9 +65,14 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { if (oneRowData == null) { return; } - WriteHandlerUtils.beforeRowCreate(writeContext, rowIndex, relativeRowIndex, Boolean.FALSE); + RowWriteHandlerContext rowWriteHandlerContext = WriteHandlerUtils.createRowWriteHandlerContext(writeContext, + rowIndex, relativeRowIndex, Boolean.FALSE); + WriteHandlerUtils.beforeRowCreate(rowWriteHandlerContext); + Row row = WorkBookUtil.createRow(writeContext.writeSheetHolder().getSheet(), rowIndex); - WriteHandlerUtils.afterRowCreate(writeContext, row, rowIndex, relativeRowIndex, Boolean.FALSE); + rowWriteHandlerContext.setRow(row); + + WriteHandlerUtils.afterRowCreate(rowWriteHandlerContext); if (oneRowData instanceof Collection) { addBasicTypeToExcel(new CollectionRowData((Collection)oneRowData), row, rowIndex, relativeRowIndex); @@ -75,7 +81,8 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { } else { addJavaObjectToExcel(oneRowData, row, rowIndex, relativeRowIndex, sortedAllFiledMap); } - WriteHandlerUtils.afterRowDispose(writeContext, row, rowIndex, relativeRowIndex, Boolean.FALSE); + + WriteHandlerUtils.afterRowDispose(rowWriteHandlerContext); } private void addBasicTypeToExcel(RowData oneRowData, Row row, int rowIndex, int relativeRowIndex) { @@ -114,25 +121,28 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { writeContext.currentWriteHolder().excelWriteHeadProperty().getHeadClazz(), head == null ? null : head.getFieldName()); - WriteHandlerUtils.beforeCellCreate(writeContext, row, head, columnIndex, relativeRowIndex, Boolean.FALSE, - excelContentProperty); + CellWriteHandlerContext cellWriteHandlerContext = WriteHandlerUtils.createCellWriteHandlerContext(writeContext, + row, rowIndex, head, columnIndex, relativeRowIndex, Boolean.FALSE, excelContentProperty); + WriteHandlerUtils.beforeCellCreate(cellWriteHandlerContext); + Cell cell = WorkBookUtil.createCell(row, columnIndex); - WriteHandlerUtils.afterCellCreate(writeContext, cell, row, head, columnIndex, relativeRowIndex, Boolean.FALSE, - excelContentProperty); - Object value = oneRowData.get(dataIndex); - WriteCellData cellData = converterAndSet(writeContext.currentWriteHolder(), - FieldUtils.getFieldClass(value), null, cell, row, value, null, head, relativeRowIndex, - rowIndex, columnIndex); - WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, row, head, columnIndex, relativeRowIndex, - Boolean.FALSE, - excelContentProperty); + cellWriteHandlerContext.setCell(cell); + + WriteHandlerUtils.afterCellCreate(cellWriteHandlerContext); + + cellWriteHandlerContext.setOriginalValue(oneRowData.get(dataIndex)); + cellWriteHandlerContext.setOriginalFieldClass( + FieldUtils.getFieldClass(cellWriteHandlerContext.getOriginalValue())); + converterAndSet(cellWriteHandlerContext); + + WriteHandlerUtils.afterCellDispose(cellWriteHandlerContext); } private void addJavaObjectToExcel(Object oneRowData, Row row, int rowIndex, int relativeRowIndex, Map sortedAllFiledMap) { WriteHolder currentWriteHolder = writeContext.currentWriteHolder(); BeanMap beanMap = BeanMapUtils.create(oneRowData); - Set beanMapHandledSet = new HashSet(); + Set beanMapHandledSet = new HashSet<>(); int maxCellIndex = -1; // If it's a class it needs to be cast by type if (HeadKindEnum.CLASS.equals(writeContext.currentWriteHolder().excelWriteHeadProperty().getHeadKind())) { @@ -144,20 +154,25 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { if (!beanMap.containsKey(name)) { continue; } + ExcelContentProperty excelContentProperty = ClassUtils.declaredExcelContentProperty(beanMap, currentWriteHolder.excelWriteHeadProperty().getHeadClazz(), name); - WriteHandlerUtils.beforeCellCreate(writeContext, row, head, columnIndex, relativeRowIndex, - Boolean.FALSE, excelContentProperty); - Cell cell = WorkBookUtil.createCell(row, columnIndex); - WriteHandlerUtils.afterCellCreate(writeContext, cell, row, head, columnIndex, relativeRowIndex, - Boolean.FALSE, - excelContentProperty); - Object value = beanMap.get(name); - WriteCellData cellData = converterAndSet(currentWriteHolder, head.getField().getType(), - null, cell, row, value, excelContentProperty, head, relativeRowIndex, rowIndex, columnIndex); - WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, row, head, columnIndex, - relativeRowIndex, Boolean.FALSE, + CellWriteHandlerContext cellWriteHandlerContext = WriteHandlerUtils.createCellWriteHandlerContext( + writeContext, row, rowIndex, head, columnIndex, relativeRowIndex, Boolean.FALSE, excelContentProperty); + WriteHandlerUtils.beforeCellCreate(cellWriteHandlerContext); + + Cell cell = WorkBookUtil.createCell(row, columnIndex); + cellWriteHandlerContext.setCell(cell); + + WriteHandlerUtils.afterCellCreate(cellWriteHandlerContext); + + cellWriteHandlerContext.setOriginalValue(beanMap.get(name)); + cellWriteHandlerContext.setOriginalFieldClass(head.getField().getType()); + converterAndSet(cellWriteHandlerContext); + + WriteHandlerUtils.afterCellDispose(cellWriteHandlerContext); + beanMapHandledSet.add(name); maxCellIndex = Math.max(maxCellIndex, columnIndex); } @@ -181,20 +196,22 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { Object value = beanMap.get(filedName); ExcelContentProperty excelContentProperty = ClassUtils.declaredExcelContentProperty(beanMap, currentWriteHolder.excelWriteHeadProperty().getHeadClazz(), filedName); - WriteHandlerUtils.beforeCellCreate(writeContext, row, null, maxCellIndex, relativeRowIndex, Boolean.FALSE, - excelContentProperty); + CellWriteHandlerContext cellWriteHandlerContext = WriteHandlerUtils.createCellWriteHandlerContext( + writeContext, row, rowIndex, null, maxCellIndex, relativeRowIndex, Boolean.FALSE, excelContentProperty); + WriteHandlerUtils.beforeCellCreate(cellWriteHandlerContext); + // fix https://github.com/alibaba/easyexcel/issues/1870 // If there is data, it is written to the next cell Cell cell = WorkBookUtil.createCell(row, maxCellIndex); - WriteHandlerUtils.afterCellCreate(writeContext, cell, row, null, maxCellIndex, relativeRowIndex, - Boolean.FALSE, - excelContentProperty); - WriteCellData cellData = converterAndSet(currentWriteHolder, - FieldUtils.getFieldClass(beanMap, filedName, value), null, cell, row, value, null, null, - relativeRowIndex, rowIndex, maxCellIndex); - WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, row, null, maxCellIndex, relativeRowIndex, - Boolean.FALSE, - excelContentProperty); + cellWriteHandlerContext.setCell(cell); + + WriteHandlerUtils.afterCellCreate(cellWriteHandlerContext); + + cellWriteHandlerContext.setOriginalValue(value); + cellWriteHandlerContext.setOriginalFieldClass(FieldUtils.getFieldClass(beanMap, filedName, value)); + converterAndSet(cellWriteHandlerContext); + + WriteHandlerUtils.afterCellDispose(cellWriteHandlerContext); maxCellIndex++; } } diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java index 2fb755a7..3eb49f2b 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java @@ -24,6 +24,8 @@ import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.MapUtils; import com.alibaba.excel.util.StringUtils; import com.alibaba.excel.util.WriteHandlerUtils; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.handler.context.RowWriteHandlerContext; import com.alibaba.excel.write.metadata.fill.AnalysisCell; import com.alibaba.excel.write.metadata.fill.FillConfig; import com.alibaba.excel.write.metadata.fill.FillWrapper; @@ -189,8 +191,11 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } else { dataMap = BeanMapUtils.create(oneRowData); } - WriteSheetHolder writeSheetHolder = writeContext.writeSheetHolder(); for (AnalysisCell analysisCell : analysisCellList) { + CellWriteHandlerContext cellWriteHandlerContext = WriteHandlerUtils.createCellWriteHandlerContext( + writeContext, null, analysisCell.getRowIndex(), null, analysisCell.getColumnIndex(), + relativeRowIndex, Boolean.FALSE, ExcelContentProperty.EMPTY); + if (analysisCell.getOnlyOneVariable()) { String variable = analysisCell.getVariableList().get(0); if (!dataMap.containsKey(variable)) { @@ -199,12 +204,14 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { Object value = dataMap.get(variable); ExcelContentProperty excelContentProperty = ClassUtils.declaredExcelContentProperty(dataMap, writeContext.currentWriteHolder().excelWriteHeadProperty().getHeadClazz(), variable); - Cell cell = getOneCell(analysisCell, fillConfig, excelContentProperty); + cellWriteHandlerContext.setExcelContentProperty(excelContentProperty); + + createCell(analysisCell, fillConfig, cellWriteHandlerContext); + cellWriteHandlerContext.setOriginalValue(value); + cellWriteHandlerContext.setOriginalFieldClass(FieldUtils.getFieldClass(dataMap, variable, value)); - WriteCellData cellData = converterAndSet(writeSheetHolder, - FieldUtils.getFieldClass(dataMap, variable, value), null, cell, value, excelContentProperty, null, - relativeRowIndex, analysisCell.getRowIndex(), analysisCell.getColumnIndex()); - cellData.setAnalysisCell(analysisCell); + converterAndSet(cellWriteHandlerContext); + WriteCellData cellData = cellWriteHandlerContext.getFirstCellData(); // Restyle if (fillConfig.getAutoStyle()) { @@ -212,14 +219,15 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { .map(collectionFieldStyleMap -> collectionFieldStyleMap.get(analysisCell)) .ifPresent(cellData::setOriginCellStyle); } - - WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, null, relativeRowIndex, Boolean.FALSE, - excelContentProperty); } else { StringBuilder cellValueBuild = new StringBuilder(); int index = 0; List> cellDataList = new ArrayList<>(); - Cell cell = getOneCell(analysisCell, fillConfig, ExcelContentProperty.EMPTY); + + cellWriteHandlerContext.setExcelContentProperty(ExcelContentProperty.EMPTY); + + createCell(analysisCell, fillConfig, cellWriteHandlerContext); + Cell cell = cellWriteHandlerContext.getCell(); for (String variable : analysisCell.getVariableList()) { cellValueBuild.append(analysisCell.getPrepareDataList().get(index++)); @@ -229,11 +237,14 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { Object value = dataMap.get(variable); ExcelContentProperty excelContentProperty = ClassUtils.declaredExcelContentProperty(dataMap, writeContext.currentWriteHolder().excelWriteHeadProperty().getHeadClazz(), variable); - WriteCellData cellData = convert(writeSheetHolder, - FieldUtils.getFieldClass(dataMap, variable, value), CellDataTypeEnum.STRING, cell, value, - excelContentProperty); - cellData.setAnalysisCell(analysisCell); + cellWriteHandlerContext.setOriginalValue(value); + cellWriteHandlerContext.setOriginalFieldClass(FieldUtils.getFieldClass(dataMap, variable, value)); + cellWriteHandlerContext.setExcelContentProperty(excelContentProperty); + cellWriteHandlerContext.setTargetCellDataType(CellDataTypeEnum.STRING); + + WriteCellData cellData = convert(cellWriteHandlerContext); cellDataList.add(cellData); + CellDataTypeEnum type = cellData.getType(); if (type != null) { switch (type) { @@ -253,6 +264,10 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } cellValueBuild.append(analysisCell.getPrepareDataList().get(index)); cell.setCellValue(cellValueBuild.toString()); + cellWriteHandlerContext.setCellDataList(cellDataList); + if (CollectionUtils.isNotEmpty(cellDataList)) { + cellWriteHandlerContext.setFirstCellData(cellDataList.get(0)); + } // Restyle if (fillConfig.getAutoStyle()) { @@ -260,10 +275,8 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { .map(collectionFieldStyleMap -> collectionFieldStyleMap.get(analysisCell)) .ifPresent(cell::setCellStyle); } - - WriteHandlerUtils.afterCellDispose(writeContext, cellDataList, cell, null, relativeRowIndex, - Boolean.FALSE, ExcelContentProperty.EMPTY); } + WriteHandlerUtils.afterCellDispose(cellWriteHandlerContext); } } @@ -278,11 +291,14 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { return relativeRowIndex; } - private Cell getOneCell(AnalysisCell analysisCell, FillConfig fillConfig, - ExcelContentProperty excelContentProperty) { + private void createCell(AnalysisCell analysisCell, FillConfig fillConfig, + CellWriteHandlerContext cellWriteHandlerContext) { Sheet cachedSheet = writeContext.writeSheetHolder().getCachedSheet(); if (WriteTemplateAnalysisCellTypeEnum.COMMON.equals(analysisCell.getCellType())) { - return cachedSheet.getRow(analysisCell.getRowIndex()).getCell(analysisCell.getColumnIndex()); + Row row = cachedSheet.getRow(analysisCell.getRowIndex()); + cellWriteHandlerContext.setRow(row); + Cell cell = row.getCell(analysisCell.getColumnIndex()); + cellWriteHandlerContext.setCell(cell); } Sheet sheet = writeContext.writeSheetHolder().getSheet(); @@ -319,31 +335,38 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { throw new ExcelGenerateException("The wrong direction."); } - Row row = createRowIfNecessary(sheet, cachedSheet, lastRowIndex, fillConfig, analysisCell, isOriginalCell); - Cell cell = createCellIfNecessary(row, lastColumnIndex, excelContentProperty); + Row row = createRowIfNecessary(sheet, cachedSheet, lastRowIndex, fillConfig, analysisCell, isOriginalCell, + cellWriteHandlerContext); + cellWriteHandlerContext.setRow(row); + + cellWriteHandlerContext.setRowIndex(lastRowIndex); + cellWriteHandlerContext.setColumnIndex(lastColumnIndex); + Cell cell = createCellIfNecessary(row, lastColumnIndex, cellWriteHandlerContext); + cellWriteHandlerContext.setCell(cell); if (isOriginalCell) { Map collectionFieldStyleMap = collectionFieldStyleCache.computeIfAbsent( currentUniqueDataFlag, key -> MapUtils.newHashMap()); collectionFieldStyleMap.put(analysisCell, cell.getCellStyle()); } - return cell; } - private Cell createCellIfNecessary(Row row, Integer lastColumnIndex, ExcelContentProperty excelContentProperty) { + private Cell createCellIfNecessary(Row row, Integer lastColumnIndex, + CellWriteHandlerContext cellWriteHandlerContext) { Cell cell = row.getCell(lastColumnIndex); if (cell != null) { return cell; } - WriteHandlerUtils.beforeCellCreate(writeContext, row, null, lastColumnIndex, null, Boolean.FALSE, - excelContentProperty); + WriteHandlerUtils.beforeCellCreate(cellWriteHandlerContext); cell = row.createCell(lastColumnIndex); - WriteHandlerUtils.afterCellCreate(writeContext, cell, null, null, Boolean.FALSE, excelContentProperty); + cellWriteHandlerContext.setCell(cell); + + WriteHandlerUtils.afterCellCreate(cellWriteHandlerContext); return cell; } private Row createRowIfNecessary(Sheet sheet, Sheet cachedSheet, Integer lastRowIndex, FillConfig fillConfig, - AnalysisCell analysisCell, boolean isOriginalCell) { + AnalysisCell analysisCell, boolean isOriginalCell, CellWriteHandlerContext cellWriteHandlerContext) { Row row = sheet.getRow(lastRowIndex); if (row != null) { checkRowHeight(analysisCell, fillConfig, isOriginalCell, row); @@ -351,7 +374,10 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } row = cachedSheet.getRow(lastRowIndex); if (row == null) { - WriteHandlerUtils.beforeRowCreate(writeContext, lastRowIndex, null, Boolean.FALSE); + RowWriteHandlerContext rowWriteHandlerContext = WriteHandlerUtils.createRowWriteHandlerContext(writeContext, + lastRowIndex, null, Boolean.FALSE); + WriteHandlerUtils.beforeRowCreate(rowWriteHandlerContext); + if (fillConfig.getForceNewRow()) { row = cachedSheet.createRow(lastRowIndex); } else { @@ -364,8 +390,10 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { row = cachedSheet.createRow(lastRowIndex); } } + rowWriteHandlerContext.setRow(row); checkRowHeight(analysisCell, fillConfig, isOriginalCell, row); - WriteHandlerUtils.afterRowCreate(writeContext, row, null, Boolean.FALSE); + + WriteHandlerUtils.afterRowCreate(rowWriteHandlerContext); } else { checkRowHeight(analysisCell, fillConfig, isOriginalCell, row); } diff --git a/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java index 27530f6f..d585db93 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java @@ -3,14 +3,16 @@ package com.alibaba.excel.write.handler.context; import java.util.List; import com.alibaba.excel.context.WriteContext; +import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.metadata.Head; import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; +import com.alibaba.excel.write.handler.WriteHandler; +import com.alibaba.excel.write.handler.impl.FillStyleCellWriteHandler; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteTableHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; -import lombok.AllArgsConstructor; import lombok.Data; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; @@ -21,7 +23,6 @@ import org.apache.poi.ss.usermodel.Row; * @author Jiaju Zhuang */ @Data -@AllArgsConstructor public class CellWriteHandlerContext { /** * write context @@ -43,6 +44,10 @@ public class CellWriteHandlerContext { * row */ private Row row; + /** + * index + */ + private Integer rowIndex; /** * cell */ @@ -78,4 +83,53 @@ public class CellWriteHandlerContext { * Field annotation configuration information. */ private ExcelContentProperty excelContentProperty; + + /** + * The value of the original + */ + private Object originalValue; + + /** + * The original field type + */ + private Class originalFieldClass; + + /** + * Target cell data type + */ + private CellDataTypeEnum targetCellDataType; + + /** + * Ignore the filling pattern and the {@code FillStyleCellWriteHandler} will not work. + * + * @see FillStyleCellWriteHandler + */ + private Boolean ignoreFillStyle; + + /** + * handler + */ + private List handlerList; + + public CellWriteHandlerContext(WriteContext writeContext, + WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder, + WriteTableHolder writeTableHolder, Row row, Integer rowIndex, Cell cell, Integer columnIndex, + Integer relativeRowIndex, Head headData, List> cellDataList, WriteCellData firstCellData, + Boolean head, ExcelContentProperty excelContentProperty, List handlerList) { + this.writeContext = writeContext; + this.writeWorkbookHolder = writeWorkbookHolder; + this.writeSheetHolder = writeSheetHolder; + this.writeTableHolder = writeTableHolder; + this.row = row; + this.rowIndex = rowIndex; + this.cell = cell; + this.columnIndex = columnIndex; + this.relativeRowIndex = relativeRowIndex; + this.headData = headData; + this.cellDataList = cellDataList; + this.firstCellData = firstCellData; + this.head = head; + this.excelContentProperty = excelContentProperty; + this.handlerList = handlerList; + } } diff --git a/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java index 6578d3a2..cf3f79e6 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java @@ -1,6 +1,9 @@ package com.alibaba.excel.write.handler.context; +import java.util.List; + import com.alibaba.excel.context.WriteContext; +import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteTableHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; @@ -49,4 +52,9 @@ public class RowWriteHandlerContext { * Nullable.It is null in the case of fill data. */ private Boolean head; + + /** + * handler + */ + private List handlerList; } diff --git a/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java index c1164eb0..17401bd8 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java @@ -1,6 +1,9 @@ package com.alibaba.excel.write.handler.context; +import java.util.List; + import com.alibaba.excel.context.WriteContext; +import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; @@ -27,4 +30,13 @@ public class SheetWriteHandlerContext { * sheet */ private WriteSheetHolder writeSheetHolder; + + /** + * handler + */ + private List handlerList; + /** + * handler + */ + private List ownHandlerList; } diff --git a/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java index f955d4bf..032f21c6 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java @@ -1,6 +1,9 @@ package com.alibaba.excel.write.handler.context; +import java.util.List; + import com.alibaba.excel.context.WriteContext; +import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import lombok.AllArgsConstructor; @@ -22,4 +25,14 @@ public class WorkbookWriteHandlerContext { * workbook */ private WriteWorkbookHolder writeWorkbookHolder; + + /** + * handler + */ + private List handlerList; + + /** + * handler + */ + private List ownHandlerList; } diff --git a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java index 819da9b1..eeae8e89 100644 --- a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java +++ b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java @@ -1,15 +1,13 @@ package com.alibaba.excel.write.handler.impl; -import java.util.List; - import com.alibaba.excel.constant.OrderConstant; import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.util.BooleanUtils; import com.alibaba.excel.write.handler.CellWriteHandler; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.CellStyle; /** @@ -27,12 +25,12 @@ public class FillStyleCellWriteHandler implements CellWriteHandler { @Override public void afterCellDispose(CellWriteHandlerContext context) { - List> cellDataList = context.getCellDataList(); - if (CollectionUtils.size(cellDataList) != 1) { + if (BooleanUtils.isTrue(context.getIgnoreFillStyle())) { return; } + WriteCellData cellData = context.getFirstCellData(); - if (cellData.getAnalysisCell() != null && !cellData.getAnalysisCell().getOnlyOneVariable()) { + if (cellData == null) { return; } WriteCellStyle writeCellStyle = cellData.getWriteCellStyle(); diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java index 5059894a..2961efc0 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java @@ -430,4 +430,5 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ public boolean automaticMergeHead() { return getAutomaticMergeHead(); } + } diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java index 580eeb97..ede60eab 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java @@ -9,9 +9,7 @@ import com.alibaba.excel.util.StringUtils; import com.alibaba.excel.write.metadata.WriteSheet; import lombok.Data; -import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.Setter; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.streaming.SXSSFSheet; diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java index 374b5b7a..ef619196 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java @@ -19,6 +19,7 @@ import com.alibaba.excel.util.FileUtils; import com.alibaba.excel.util.IoUtils; import com.alibaba.excel.util.MapUtils; import com.alibaba.excel.util.StyleUtil; +import com.alibaba.excel.write.handler.context.WorkbookWriteHandlerContext; import com.alibaba.excel.write.metadata.WriteWorkbook; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; @@ -143,6 +144,11 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { */ private Map dataFormatMap; + /** + * handler context + */ + private WorkbookWriteHandlerContext workbookWriteHandlerContext; + public WriteWorkbookHolder(WriteWorkbook writeWorkbook) { super(writeWorkbook, null); this.writeWorkbook = writeWorkbook; From 4ea45e6e5c7657ee75ed45911a9cf3855c9e538b Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Tue, 26 Oct 2021 15:52:16 +0800 Subject: [PATCH 03/12] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D=E5=86=99=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E6=80=A7=E8=83=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/write/handler/impl/FillStyleCellWriteHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java index eeae8e89..d3680e24 100644 --- a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java +++ b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java @@ -5,6 +5,7 @@ import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.util.BooleanUtils; import com.alibaba.excel.write.handler.CellWriteHandler; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import lombok.extern.slf4j.Slf4j; @@ -38,8 +39,8 @@ public class FillStyleCellWriteHandler implements CellWriteHandler { if (writeCellStyle == null && originCellStyle == null) { return; } - //WriteWorkbookHolder writeWorkbookHolder = context.getWriteWorkbookHolder(); - //context.getCell().setCellStyle(writeWorkbookHolder.createCellStyle(writeCellStyle, originCellStyle)); + WriteWorkbookHolder writeWorkbookHolder = context.getWriteWorkbookHolder(); + context.getCell().setCellStyle(writeWorkbookHolder.createCellStyle(writeCellStyle, originCellStyle)); } } From 031fefde92300094ea286913f923d8a77e88797a Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 16:30:20 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BB=E5=86=99?= =?UTF-8?q?=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/v07/handlers/CellTagHandler.java | 18 +- .../excel/context/WriteContextImpl.java | 7 +- .../listener/ModelBuildEventListener.java | 4 +- .../holder/xlsx/XlsxReadWorkbookHolder.java | 50 ++--- .../com/alibaba/excel/util/PositionUtils.java | 61 ++---- .../alibaba/excel/util/WriteHandlerUtils.java | 203 +++++++----------- .../write/executor/ExcelWriteAddExecutor.java | 6 +- .../executor/ExcelWriteFillExecutor.java | 10 +- .../chain/CellHandlerExecutionChain.java | 63 ++++++ .../chain/RowHandlerExecutionChain.java | 56 +++++ .../chain/SheetHandlerExecutionChain.java | 48 +++++ .../chain/WorkbookHandlerExecutionChain.java | 57 +++++ .../context/CellWriteHandlerContext.java | 9 +- .../context/RowWriteHandlerContext.java | 8 - .../context/SheetWriteHandlerContext.java | 12 -- .../context/WorkbookWriteHandlerContext.java | 13 -- .../metadata/holder/AbstractWriteHolder.java | 183 ++++++++++------ .../write/metadata/holder/WriteHolder.java | 18 -- .../metadata/holder/WriteWorkbookHolder.java | 11 +- .../easyexcel/test/temp/Lock2Test.java | 17 ++ 20 files changed, 501 insertions(+), 353 deletions(-) create mode 100644 src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java create mode 100644 src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java create mode 100644 src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java create mode 100644 src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java diff --git a/src/main/java/com/alibaba/excel/analysis/v07/handlers/CellTagHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/handlers/CellTagHandler.java index a6fd5340..9d8e4736 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/handlers/CellTagHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/handlers/CellTagHandler.java @@ -2,19 +2,15 @@ package com.alibaba.excel.analysis.v07.handlers; import java.math.BigDecimal; -import com.alibaba.excel.constant.BuiltinFormats; import com.alibaba.excel.constant.ExcelXmlConstants; import com.alibaba.excel.context.xlsx.XlsxReadContext; import com.alibaba.excel.enums.CellDataTypeEnum; -import com.alibaba.excel.metadata.data.DataFormatData; import com.alibaba.excel.metadata.data.ReadCellData; import com.alibaba.excel.read.metadata.holder.xlsx.XlsxReadSheetHolder; import com.alibaba.excel.util.BooleanUtils; import com.alibaba.excel.util.PositionUtils; import com.alibaba.excel.util.StringUtils; -import org.apache.poi.xssf.model.StylesTable; -import org.apache.poi.xssf.usermodel.XSSFCellStyle; import org.xml.sax.Attributes; /** @@ -51,17 +47,9 @@ public class CellTagHandler extends AbstractXlsxTagHandler { } else { dateFormatIndexInteger = Integer.parseInt(dateFormatIndex); } - StylesTable stylesTable = xlsxReadContext.xlsxReadWorkbookHolder().getStylesTable(); - if (stylesTable == null) { - return; - } - XSSFCellStyle xssfCellStyle = stylesTable.getStyleAt(dateFormatIndexInteger); - short dataFormat = xssfCellStyle.getDataFormat(); - DataFormatData dataFormatData = new DataFormatData(); - dataFormatData.setIndex(dataFormat); - dataFormatData.setFormat(BuiltinFormats.getBuiltinFormat(dataFormat, - xssfCellStyle.getDataFormatString(), xlsxReadSheetHolder.getGlobalConfiguration().getLocale())); - xlsxReadSheetHolder.getTempCellData().setDataFormatData(dataFormatData); + + xlsxReadSheetHolder.getTempCellData().setDataFormatData( + xlsxReadContext.xlsxReadWorkbookHolder().dataFormatData(dateFormatIndexInteger)); } @Override diff --git a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java index 7ee3b2c9..db892989 100644 --- a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java @@ -127,7 +127,7 @@ public class WriteContextImpl implements WriteContext { // Workbook handler need to supplementary execution WorkbookWriteHandlerContext workbookWriteHandlerContext = WriteHandlerUtils.createWorkbookWriteHandlerContext( - this, true); + this); WriteHandlerUtils.beforeWorkbookCreate(workbookWriteHandlerContext, true); WriteHandlerUtils.afterWorkbookCreate(workbookWriteHandlerContext, true); @@ -310,12 +310,11 @@ public class WriteContextImpl implements WriteContext { // Workbook and sheet handler need to supplementary execution WorkbookWriteHandlerContext workbookWriteHandlerContext = WriteHandlerUtils.createWorkbookWriteHandlerContext( - this, true); + this); WriteHandlerUtils.beforeWorkbookCreate(workbookWriteHandlerContext, true); WriteHandlerUtils.afterWorkbookCreate(workbookWriteHandlerContext, true); - SheetWriteHandlerContext sheetWriteHandlerContext = WriteHandlerUtils.createSheetWriteHandlerContext(this, - true); + SheetWriteHandlerContext sheetWriteHandlerContext = WriteHandlerUtils.createSheetWriteHandlerContext(this); WriteHandlerUtils.beforeSheetCreate(sheetWriteHandlerContext, true); WriteHandlerUtils.afterSheetCreate(sheetWriteHandlerContext, true); diff --git a/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java b/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java index 7ba8b88f..5c8bf4bb 100644 --- a/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java +++ b/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java @@ -91,7 +91,6 @@ public class ModelBuildEventListener implements ReadListener headMap = excelReadHeadProperty.getHeadMap(); - Map map = MapUtils.newHashMapWithExpectedSize(headMap.size()); BeanMap dataMap = BeanMapUtils.create(resultModel); for (Map.Entry entry : headMap.entrySet()) { Integer index = entry.getKey(); @@ -105,10 +104,9 @@ public class ModelBuildEventListener implements ReadListener dataFormatDataCache; public XlsxReadWorkbookHolder(ReadWorkbook readWorkbook) { super(readWorkbook); @@ -41,27 +52,18 @@ public class XlsxReadWorkbookHolder extends ReadWorkbookHolder { setExcelType(ExcelTypeEnum.XLSX); } - public OPCPackage getOpcPackage() { - return opcPackage; + public DataFormatData dataFormatData(int dateFormatIndexInteger) { + return dataFormatDataCache.computeIfAbsent(dateFormatIndexInteger, key -> { + DataFormatData dataFormatData = new DataFormatData(); + if (stylesTable == null) { + return null; + } + XSSFCellStyle xssfCellStyle = stylesTable.getStyleAt(dateFormatIndexInteger); + dataFormatData.setIndex(xssfCellStyle.getDataFormat()); + dataFormatData.setFormat(BuiltinFormats.getBuiltinFormat(dataFormatData.getIndex(), + xssfCellStyle.getDataFormatString(), globalConfiguration().getLocale())); + return dataFormatData; + }); } - public void setOpcPackage(OPCPackage opcPackage) { - this.opcPackage = opcPackage; - } - - public String getSaxParserFactoryName() { - return saxParserFactoryName; - } - - public void setSaxParserFactoryName(String saxParserFactoryName) { - this.saxParserFactoryName = saxParserFactoryName; - } - - public StylesTable getStylesTable() { - return stylesTable; - } - - public void setStylesTable(StylesTable stylesTable) { - this.stylesTable = stylesTable; - } } diff --git a/src/main/java/com/alibaba/excel/util/PositionUtils.java b/src/main/java/com/alibaba/excel/util/PositionUtils.java index 48c5cde5..fe7e5d4e 100644 --- a/src/main/java/com/alibaba/excel/util/PositionUtils.java +++ b/src/main/java/com/alibaba/excel/util/PositionUtils.java @@ -1,11 +1,7 @@ package com.alibaba.excel.util; -import java.util.Locale; -import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.poi.ss.util.CellReference; - /** * @author jipengfei */ @@ -18,14 +14,6 @@ public class PositionUtils { private PositionUtils() {} - public static int getRowByRowTagt(String rowTagt) { - int row = 0; - if (rowTagt != null) { - row = Integer.parseInt(rowTagt) - 1; - } - return row; - } - public static int getRowByRowTagt(String rowTagt, Integer before) { int row; if (rowTagt != null) { @@ -37,47 +25,40 @@ public class PositionUtils { } return before + 1; } - } public static int getRow(String currentCellIndex) { - if (currentCellIndex != null) { - int plingPos = currentCellIndex.lastIndexOf(SHEET_NAME_DELIMITER); - String cell = currentCellIndex.substring(plingPos + 1).toUpperCase(Locale.ROOT); - Matcher matcher = CELL_REF_PATTERN.matcher(cell); - if (!matcher.matches()) { - throw new IllegalArgumentException("Invalid CellReference: " + currentCellIndex); + if (currentCellIndex == null) { + return -1; + } + int firstNumber = currentCellIndex.length() - 1; + for (; firstNumber >= 0; firstNumber--) { + char c = currentCellIndex.charAt(firstNumber); + if (c < '0' || c > '9') { + break; } - String row = matcher.group(2); - return Integer.parseInt(row) - 1; } - return -1; + return Integer.parseUnsignedInt(currentCellIndex.substring(firstNumber + 1)) - 1; } public static int getCol(String currentCellIndex, Integer before) { - if (currentCellIndex != null) { - int plingPos = currentCellIndex.lastIndexOf(SHEET_NAME_DELIMITER); - String cell = currentCellIndex.substring(plingPos + 1).toUpperCase(Locale.ROOT); - Matcher matcher = CELL_REF_PATTERN.matcher(cell); - if (!matcher.matches()) { - throw new IllegalArgumentException("Invalid CellReference: " + currentCellIndex); - } - String col = matcher.group(1); - - if (col.length() > 0 && col.charAt(0) == REDUNDANT_CHARACTERS) { - col = col.substring(1); - } - if (col.length() == 0) { - return -1; - } else { - return CellReference.convertColStringToIndex(col); - } - } else { + if (currentCellIndex == null) { if (before == null) { before = -1; } return before + 1; } + int firstNumber = currentCellIndex.charAt(0) == REDUNDANT_CHARACTERS ? 1 : 0; + int col = 0; + for (; firstNumber < currentCellIndex.length(); firstNumber++) { + char c = currentCellIndex.charAt(firstNumber); + boolean isNotLetter = c == REDUNDANT_CHARACTERS || (c >= '0' && c <= '9'); + if (isNotLetter) { + break; + } + col = col * 26 + Character.toUpperCase(c) - 'A' + 1; + } + return col - 1; } } diff --git a/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java b/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java index cb04b956..062bfdc7 100644 --- a/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java +++ b/src/main/java/com/alibaba/excel/util/WriteHandlerUtils.java @@ -1,22 +1,19 @@ package com.alibaba.excel.util; -import java.util.List; -import java.util.Map; - import com.alibaba.excel.context.WriteContext; import com.alibaba.excel.metadata.Head; import com.alibaba.excel.metadata.property.ExcelContentProperty; -import com.alibaba.excel.write.handler.CellWriteHandler; -import com.alibaba.excel.write.handler.RowWriteHandler; -import com.alibaba.excel.write.handler.SheetWriteHandler; -import com.alibaba.excel.write.handler.WorkbookWriteHandler; -import com.alibaba.excel.write.handler.WriteHandler; +import com.alibaba.excel.write.handler.chain.CellHandlerExecutionChain; +import com.alibaba.excel.write.handler.chain.RowHandlerExecutionChain; +import com.alibaba.excel.write.handler.chain.SheetHandlerExecutionChain; +import com.alibaba.excel.write.handler.chain.WorkbookHandlerExecutionChain; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; import com.alibaba.excel.write.handler.context.RowWriteHandlerContext; import com.alibaba.excel.write.handler.context.SheetWriteHandlerContext; import com.alibaba.excel.write.handler.context.WorkbookWriteHandlerContext; +import com.alibaba.excel.write.metadata.holder.AbstractWriteHolder; -import org.apache.commons.collections4.CollectionUtils; +import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Row; /** @@ -24,23 +21,14 @@ import org.apache.poi.ss.usermodel.Row; * * @author Jiaju Zhuang */ +@Slf4j public class WriteHandlerUtils { private WriteHandlerUtils() {} public static WorkbookWriteHandlerContext createWorkbookWriteHandlerContext(WriteContext writeContext) { - return createWorkbookWriteHandlerContext(writeContext, false); - } - - public static WorkbookWriteHandlerContext createWorkbookWriteHandlerContext(WriteContext writeContext, - boolean runOwn) { - List handlerList = getHandlerList(writeContext, WorkbookWriteHandler.class, runOwn); - WorkbookWriteHandlerContext context = new WorkbookWriteHandlerContext(writeContext, null, null, null); - if (runOwn) { - context.setOwnHandlerList(handlerList); - } else { - context.setHandlerList(handlerList); - } + WorkbookWriteHandlerContext context = new WorkbookWriteHandlerContext(writeContext, + writeContext.writeWorkbookHolder()); writeContext.writeWorkbookHolder().setWorkbookWriteHandlerContext(context); return context; } @@ -50,16 +38,9 @@ public class WriteHandlerUtils { } public static void beforeWorkbookCreate(WorkbookWriteHandlerContext context, boolean runOwn) { - List handlerList; - if (runOwn) { - handlerList = context.getOwnHandlerList(); - } else { - handlerList = context.getHandlerList(); - } - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((WorkbookWriteHandler)writeHandler).beforeWorkbookCreate(context); - } + WorkbookHandlerExecutionChain workbookHandlerExecutionChain = getWorkbookHandlerExecutionChain(context, runOwn); + if (workbookHandlerExecutionChain != null) { + workbookHandlerExecutionChain.beforeWorkbookCreate(context); } } @@ -68,42 +49,32 @@ public class WriteHandlerUtils { } public static void afterWorkbookCreate(WorkbookWriteHandlerContext context, boolean runOwn) { - List handlerList; + WorkbookHandlerExecutionChain workbookHandlerExecutionChain = getWorkbookHandlerExecutionChain(context, runOwn); + if (workbookHandlerExecutionChain != null) { + workbookHandlerExecutionChain.afterWorkbookCreate(context); + } + } + + private static WorkbookHandlerExecutionChain getWorkbookHandlerExecutionChain(WorkbookWriteHandlerContext context, + boolean runOwn) { + AbstractWriteHolder abstractWriteHolder = (AbstractWriteHolder)context.getWriteContext().currentWriteHolder(); if (runOwn) { - handlerList = context.getOwnHandlerList(); + return abstractWriteHolder.getOwnWorkbookHandlerExecutionChain(); } else { - handlerList = context.getHandlerList(); - } - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((WorkbookWriteHandler)writeHandler).afterWorkbookCreate(context); - } + return abstractWriteHolder.getWorkbookHandlerExecutionChain(); } } public static void afterWorkbookDispose(WorkbookWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((WorkbookWriteHandler)writeHandler).afterWorkbookDispose(context); - } + WorkbookHandlerExecutionChain workbookHandlerExecutionChain = getWorkbookHandlerExecutionChain(context, false); + if (workbookHandlerExecutionChain != null) { + workbookHandlerExecutionChain.afterWorkbookDispose(context); } } public static SheetWriteHandlerContext createSheetWriteHandlerContext(WriteContext writeContext) { - return createSheetWriteHandlerContext(writeContext, false); - } - - public static SheetWriteHandlerContext createSheetWriteHandlerContext(WriteContext writeContext, boolean runOwn) { - List handlerList = getHandlerList(writeContext, SheetWriteHandler.class, runOwn); - SheetWriteHandlerContext context = new SheetWriteHandlerContext(writeContext, - writeContext.writeWorkbookHolder(), writeContext.writeSheetHolder(), null, null); - if (runOwn) { - context.setOwnHandlerList(handlerList); - } else { - context.setHandlerList(handlerList); - } - return context; + return new SheetWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), + writeContext.writeSheetHolder()); } public static void beforeSheetCreate(SheetWriteHandlerContext context) { @@ -111,16 +82,9 @@ public class WriteHandlerUtils { } public static void beforeSheetCreate(SheetWriteHandlerContext context, boolean runOwn) { - List handlerList; - if (runOwn) { - handlerList = context.getOwnHandlerList(); - } else { - handlerList = context.getHandlerList(); - } - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((SheetWriteHandler)writeHandler).beforeSheetCreate(context); - } + SheetHandlerExecutionChain sheetHandlerExecutionChain = getSheetHandlerExecutionChain(context, runOwn); + if (sheetHandlerExecutionChain != null) { + sheetHandlerExecutionChain.beforeSheetCreate(context); } } @@ -129,111 +93,90 @@ public class WriteHandlerUtils { } public static void afterSheetCreate(SheetWriteHandlerContext context, boolean runOwn) { - List handlerList; + SheetHandlerExecutionChain sheetHandlerExecutionChain = getSheetHandlerExecutionChain(context, runOwn); + if (sheetHandlerExecutionChain != null) { + sheetHandlerExecutionChain.afterSheetCreate(context); + } + } + + private static SheetHandlerExecutionChain getSheetHandlerExecutionChain(SheetWriteHandlerContext context, + boolean runOwn) { + AbstractWriteHolder abstractWriteHolder = (AbstractWriteHolder)context.getWriteContext().currentWriteHolder(); if (runOwn) { - handlerList = context.getOwnHandlerList(); + return abstractWriteHolder.getOwnSheetHandlerExecutionChain(); } else { - handlerList = context.getHandlerList(); - } - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((SheetWriteHandler)writeHandler).afterSheetCreate(context); - } + return abstractWriteHolder.getSheetHandlerExecutionChain(); } } public static CellWriteHandlerContext createCellWriteHandlerContext(WriteContext writeContext, Row row, Integer rowIndex, Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead, ExcelContentProperty excelContentProperty) { - List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get( - CellWriteHandler.class); return new CellWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), writeContext.writeSheetHolder(), writeContext.writeTableHolder(), row, rowIndex, null, columnIndex, - relativeRowIndex, head, null, null, isHead, excelContentProperty, handlerList); + relativeRowIndex, head, null, null, isHead, excelContentProperty); } public static void beforeCellCreate(CellWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((CellWriteHandler)writeHandler).beforeCellCreate(context); - } + CellHandlerExecutionChain cellHandlerExecutionChain = ((AbstractWriteHolder)context.getWriteContext() + .currentWriteHolder()).getCellHandlerExecutionChain(); + if (cellHandlerExecutionChain != null) { + cellHandlerExecutionChain.beforeCellCreate(context); } } public static void afterCellCreate(CellWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((CellWriteHandler)writeHandler).afterCellCreate(context); - } + CellHandlerExecutionChain cellHandlerExecutionChain = ((AbstractWriteHolder)context.getWriteContext() + .currentWriteHolder()).getCellHandlerExecutionChain(); + if (cellHandlerExecutionChain != null) { + cellHandlerExecutionChain.afterCellCreate(context); } } public static void afterCellDataConverted(CellWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((CellWriteHandler)writeHandler).afterCellDataConverted(context); - } + CellHandlerExecutionChain cellHandlerExecutionChain = ((AbstractWriteHolder)context.getWriteContext() + .currentWriteHolder()).getCellHandlerExecutionChain(); + if (cellHandlerExecutionChain != null) { + cellHandlerExecutionChain.afterCellDataConverted(context); } } public static void afterCellDispose(CellWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((CellWriteHandler)writeHandler).afterCellDispose(context); - } + CellHandlerExecutionChain cellHandlerExecutionChain = ((AbstractWriteHolder)context.getWriteContext() + .currentWriteHolder()).getCellHandlerExecutionChain(); + if (cellHandlerExecutionChain != null) { + cellHandlerExecutionChain.afterCellDispose(context); } } public static RowWriteHandlerContext createRowWriteHandlerContext(WriteContext writeContext, Integer rowIndex, Integer relativeRowIndex, Boolean isHead) { - List handlerList = writeContext.currentWriteHolder().writeHandlerMap().get( - RowWriteHandler.class); - return new RowWriteHandlerContext(writeContext, - writeContext.writeWorkbookHolder(), - writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, null, relativeRowIndex, - isHead, handlerList); + return new RowWriteHandlerContext(writeContext, writeContext.writeWorkbookHolder(), + writeContext.writeSheetHolder(), writeContext.writeTableHolder(), rowIndex, null, relativeRowIndex, isHead); } public static void beforeRowCreate(RowWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((RowWriteHandler)writeHandler).beforeRowCreate(context); - } + RowHandlerExecutionChain rowHandlerExecutionChain = ((AbstractWriteHolder)context.getWriteContext() + .currentWriteHolder()).getRowHandlerExecutionChain(); + if (rowHandlerExecutionChain != null) { + rowHandlerExecutionChain.beforeRowCreate(context); } } public static void afterRowCreate(RowWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((RowWriteHandler)writeHandler).afterRowCreate(context); - } + RowHandlerExecutionChain rowHandlerExecutionChain = ((AbstractWriteHolder)context.getWriteContext() + .currentWriteHolder()).getRowHandlerExecutionChain(); + if (rowHandlerExecutionChain != null) { + rowHandlerExecutionChain.afterRowCreate(context); } } public static void afterRowDispose(RowWriteHandlerContext context) { - List handlerList = context.getHandlerList(); - if (CollectionUtils.isNotEmpty(handlerList)) { - for (WriteHandler writeHandler : handlerList) { - ((RowWriteHandler)writeHandler).afterRowDispose(context); - } + RowHandlerExecutionChain rowHandlerExecutionChain = ((AbstractWriteHolder)context.getWriteContext() + .currentWriteHolder()).getRowHandlerExecutionChain(); + if (rowHandlerExecutionChain != null) { + rowHandlerExecutionChain.afterRowDispose(context); } } - private static List getHandlerList(WriteContext writeContext, Class clazz, - boolean runOwn) { - Map, List> writeHandlerMap; - if (runOwn) { - writeHandlerMap = writeContext.currentWriteHolder().ownWriteHandlerMap(); - } else { - writeHandlerMap = writeContext.currentWriteHolder().writeHandlerMap(); - } - return writeHandlerMap.get(clazz); - } } diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java index ffb8844c..0bb4007c 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java @@ -142,6 +142,8 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { Map sortedAllFiledMap) { WriteHolder currentWriteHolder = writeContext.currentWriteHolder(); BeanMap beanMap = BeanMapUtils.create(oneRowData); + // Bean the contains of the Map Key method with poor performance,So to create a keySet here + Set beanKeySet = new HashSet<>(beanMap.keySet()); Set beanMapHandledSet = new HashSet<>(); int maxCellIndex = -1; // If it's a class it needs to be cast by type @@ -151,7 +153,7 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { int columnIndex = entry.getKey(); Head head = entry.getValue(); String name = head.getFieldName(); - if (!beanMap.containsKey(name)) { + if (!beanKeySet.contains(name)) { continue; } @@ -188,7 +190,7 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { for (Map.Entry entry : sortedAllFiledMap.entrySet()) { Field field = entry.getValue(); String filedName = FieldUtils.resolveCglibFieldName(field); - boolean uselessData = !beanMap.containsKey(filedName) || beanMapHandledSet.contains(filedName) + boolean uselessData = !beanKeySet.contains(filedName) || beanMapHandledSet.contains(filedName) || ignoreMap.containsKey(filedName); if (uselessData) { continue; diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java index 3eb49f2b..97b8928e 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java @@ -185,12 +185,14 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { if (CollectionUtils.isEmpty(analysisCellList) || oneRowData == null) { return; } - Map dataMap; + Map dataMap; if (oneRowData instanceof Map) { - dataMap = (Map)oneRowData; + dataMap = (Map)oneRowData; } else { dataMap = BeanMapUtils.create(oneRowData); } + Set dataKeySet = new HashSet(dataMap.keySet()); + for (AnalysisCell analysisCell : analysisCellList) { CellWriteHandlerContext cellWriteHandlerContext = WriteHandlerUtils.createCellWriteHandlerContext( writeContext, null, analysisCell.getRowIndex(), null, analysisCell.getColumnIndex(), @@ -198,7 +200,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { if (analysisCell.getOnlyOneVariable()) { String variable = analysisCell.getVariableList().get(0); - if (!dataMap.containsKey(variable)) { + if (!dataKeySet.contains(variable)) { continue; } Object value = dataMap.get(variable); @@ -231,7 +233,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { for (String variable : analysisCell.getVariableList()) { cellValueBuild.append(analysisCell.getPrepareDataList().get(index++)); - if (!dataMap.containsKey(variable)) { + if (!dataKeySet.contains(variable)) { continue; } Object value = dataMap.get(variable); diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java new file mode 100644 index 00000000..4826d6bc --- /dev/null +++ b/src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java @@ -0,0 +1,63 @@ +package com.alibaba.excel.write.handler.chain; + +import com.alibaba.excel.write.handler.CellWriteHandler; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; + +import lombok.Data; + +/** + * Execute the cell handler chain + * + * @author Jiaju Zhuang + */ +@Data +public class CellHandlerExecutionChain { + /** + * next chain + */ + private CellHandlerExecutionChain next; + /** + * handler + */ + private CellWriteHandler handler; + + public CellHandlerExecutionChain(CellWriteHandler handler) { + this.handler = handler; + } + + public void beforeCellCreate(CellWriteHandlerContext context) { + this.handler.beforeCellCreate(context); + if (this.next != null) { + this.next.beforeCellCreate(context); + } + } + + public void afterCellCreate(CellWriteHandlerContext context) { + this.handler.afterCellCreate(context); + if (this.next != null) { + this.next.afterCellCreate(context); + } + } + + public void afterCellDataConverted(CellWriteHandlerContext context) { + this.handler.afterCellDataConverted(context); + if (this.next != null) { + this.next.afterCellDataConverted(context); + } + } + + public void afterCellDispose(CellWriteHandlerContext context) { + this.handler.afterCellDispose(context); + if (this.next != null) { + this.next.afterCellDispose(context); + } + } + + public void addLast(CellWriteHandler handler) { + CellHandlerExecutionChain context = this; + while (context.next != null) { + context = context.next; + } + context.next = new CellHandlerExecutionChain(handler); + } +} diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java new file mode 100644 index 00000000..872afa8a --- /dev/null +++ b/src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java @@ -0,0 +1,56 @@ +package com.alibaba.excel.write.handler.chain; + +import com.alibaba.excel.write.handler.RowWriteHandler; +import com.alibaba.excel.write.handler.context.RowWriteHandlerContext; + +import lombok.Data; + +/** + * Execute the row handler chain + * + * @author Jiaju Zhuang + */ +@Data +public class RowHandlerExecutionChain { + /** + * next chain + */ + private RowHandlerExecutionChain next; + /** + * handler + */ + private RowWriteHandler handler; + + public RowHandlerExecutionChain(RowWriteHandler handler) { + this.handler = handler; + } + + public void beforeRowCreate(RowWriteHandlerContext context) { + this.handler.beforeRowCreate(context); + if (this.next != null) { + this.next.beforeRowCreate(context); + } + } + + public void afterRowCreate(RowWriteHandlerContext context) { + this.handler.afterRowCreate(context); + if (this.next != null) { + this.next.afterRowCreate(context); + } + } + + public void afterRowDispose(RowWriteHandlerContext context) { + this.handler.afterRowDispose(context); + if (this.next != null) { + this.next.afterRowDispose(context); + } + } + + public void addLast(RowWriteHandler handler) { + RowHandlerExecutionChain context = this; + while (context.next != null) { + context = context.next; + } + context.next = new RowHandlerExecutionChain(handler); + } +} diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java new file mode 100644 index 00000000..56770496 --- /dev/null +++ b/src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java @@ -0,0 +1,48 @@ +package com.alibaba.excel.write.handler.chain; + +import com.alibaba.excel.write.handler.SheetWriteHandler; +import com.alibaba.excel.write.handler.context.SheetWriteHandlerContext; + +import lombok.Data; + +/** + * Execute the sheet handler chain + * + * @author Jiaju Zhuang + */ +@Data +public class SheetHandlerExecutionChain { + /** + * next chain + */ + private SheetHandlerExecutionChain next; + /** + * handler + */ + private SheetWriteHandler handler; + + public SheetHandlerExecutionChain(SheetWriteHandler handler) { + this.handler = handler; + } + + public void beforeSheetCreate(SheetWriteHandlerContext context) { + this.handler.beforeSheetCreate(context); + if (this.next != null) { + this.next.beforeSheetCreate(context); + } + } + + public void afterSheetCreate(SheetWriteHandlerContext context) { + this.handler.afterSheetCreate(context); + if (this.next != null) { + this.next.afterSheetCreate(context); + } + } + public void addLast(SheetWriteHandler handler) { + SheetHandlerExecutionChain context = this; + while (context.next != null) { + context = context.next; + } + context.next = new SheetHandlerExecutionChain(handler); + } +} diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java new file mode 100644 index 00000000..c7dacbb4 --- /dev/null +++ b/src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java @@ -0,0 +1,57 @@ +package com.alibaba.excel.write.handler.chain; + +import com.alibaba.excel.write.handler.WorkbookWriteHandler; +import com.alibaba.excel.write.handler.context.WorkbookWriteHandlerContext; + +import lombok.Data; + +/** + * Execute the workbook handler chain + * + * @author Jiaju Zhuang + */ +@Data +public class WorkbookHandlerExecutionChain { + /** + * next chain + */ + private WorkbookHandlerExecutionChain next; + + /** + * handler + */ + private WorkbookWriteHandler handler; + + public WorkbookHandlerExecutionChain(WorkbookWriteHandler handler) { + this.handler = handler; + } + + public void beforeWorkbookCreate(WorkbookWriteHandlerContext context) { + this.handler.beforeWorkbookCreate(context); + if (this.next != null) { + this.next.beforeWorkbookCreate(context); + } + } + + public void afterWorkbookCreate(WorkbookWriteHandlerContext context) { + this.handler.afterWorkbookCreate(context); + if (this.next != null) { + this.next.afterWorkbookCreate(context); + } + } + + public void afterWorkbookDispose(WorkbookWriteHandlerContext context) { + this.handler.afterWorkbookDispose(context); + if (this.next != null) { + this.next.afterWorkbookDispose(context); + } + } + + public void addLast(WorkbookWriteHandler handler) { + WorkbookHandlerExecutionChain context = this; + while (context.next != null) { + context = context.next; + } + context.next = new WorkbookHandlerExecutionChain(handler); + } +} diff --git a/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java index d585db93..bd6b1930 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java @@ -7,7 +7,6 @@ import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.metadata.Head; import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; -import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.handler.impl.FillStyleCellWriteHandler; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteTableHolder; @@ -106,16 +105,11 @@ public class CellWriteHandlerContext { */ private Boolean ignoreFillStyle; - /** - * handler - */ - private List handlerList; - public CellWriteHandlerContext(WriteContext writeContext, WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer rowIndex, Cell cell, Integer columnIndex, Integer relativeRowIndex, Head headData, List> cellDataList, WriteCellData firstCellData, - Boolean head, ExcelContentProperty excelContentProperty, List handlerList) { + Boolean head, ExcelContentProperty excelContentProperty) { this.writeContext = writeContext; this.writeWorkbookHolder = writeWorkbookHolder; this.writeSheetHolder = writeSheetHolder; @@ -130,6 +124,5 @@ public class CellWriteHandlerContext { this.firstCellData = firstCellData; this.head = head; this.excelContentProperty = excelContentProperty; - this.handlerList = handlerList; } } diff --git a/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java index cf3f79e6..6578d3a2 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java @@ -1,9 +1,6 @@ package com.alibaba.excel.write.handler.context; -import java.util.List; - import com.alibaba.excel.context.WriteContext; -import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteTableHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; @@ -52,9 +49,4 @@ public class RowWriteHandlerContext { * Nullable.It is null in the case of fill data. */ private Boolean head; - - /** - * handler - */ - private List handlerList; } diff --git a/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java index 17401bd8..c1164eb0 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java @@ -1,9 +1,6 @@ package com.alibaba.excel.write.handler.context; -import java.util.List; - import com.alibaba.excel.context.WriteContext; -import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; @@ -30,13 +27,4 @@ public class SheetWriteHandlerContext { * sheet */ private WriteSheetHolder writeSheetHolder; - - /** - * handler - */ - private List handlerList; - /** - * handler - */ - private List ownHandlerList; } diff --git a/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java index 032f21c6..f955d4bf 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java @@ -1,9 +1,6 @@ package com.alibaba.excel.write.handler.context; -import java.util.List; - import com.alibaba.excel.context.WriteContext; -import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import lombok.AllArgsConstructor; @@ -25,14 +22,4 @@ public class WorkbookWriteHandlerContext { * workbook */ private WriteWorkbookHolder writeWorkbookHolder; - - /** - * handler - */ - private List handlerList; - - /** - * handler - */ - private List ownHandlerList; } diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java index 2961efc0..cc4b2f21 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java @@ -15,7 +15,6 @@ import com.alibaba.excel.converters.ConverterKeyBuild; import com.alibaba.excel.converters.DefaultConverterLoader; import com.alibaba.excel.enums.HeadKindEnum; import com.alibaba.excel.event.NotRepeatExecutor; -import com.alibaba.excel.event.Order; import com.alibaba.excel.metadata.AbstractHolder; import com.alibaba.excel.metadata.Head; import com.alibaba.excel.metadata.property.ExcelContentProperty; @@ -28,6 +27,10 @@ import com.alibaba.excel.write.handler.RowWriteHandler; import com.alibaba.excel.write.handler.SheetWriteHandler; import com.alibaba.excel.write.handler.WorkbookWriteHandler; import com.alibaba.excel.write.handler.WriteHandler; +import com.alibaba.excel.write.handler.chain.CellHandlerExecutionChain; +import com.alibaba.excel.write.handler.chain.RowHandlerExecutionChain; +import com.alibaba.excel.write.handler.chain.SheetHandlerExecutionChain; +import com.alibaba.excel.write.handler.chain.WorkbookHandlerExecutionChain; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; import com.alibaba.excel.write.merge.LoopMergeStrategy; import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy; @@ -62,15 +65,6 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ * Excel head property */ private ExcelWriteHeadProperty excelWriteHeadProperty; - /** - * Write handler - */ - private Map, List> writeHandlerMap; - /** - * Own write handler.Created in the sheet in the workbook interceptors will not be executed because the workbook to - * create an event long past. So when initializing sheet, supplementary workbook event. - */ - private Map, List> ownWriteHandlerMap; /** * Use the default style.Default is true. */ @@ -97,6 +91,43 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ */ private Collection includeColumnFieldNames; + /** + * Write handler + */ + private List writeHandlerList; + + /** + * Execute the workbook handler chain + * Created in the sheet in the workbook interceptors will not be executed because the workbook to + * create an event long past. So when initializing sheet, supplementary workbook event. + */ + public WorkbookHandlerExecutionChain ownWorkbookHandlerExecutionChain; + /** + * Execute the sheet handler chain + * Created in the sheet in the workbook interceptors will not be executed because the workbook to + * create an event long past. So when initializing sheet, supplementary workbook event. + */ + public SheetHandlerExecutionChain ownSheetHandlerExecutionChain; + + /** + * Execute the workbook handler chain + */ + public WorkbookHandlerExecutionChain workbookHandlerExecutionChain; + /** + * Execute the sheet handler chain + */ + public SheetHandlerExecutionChain sheetHandlerExecutionChain; + + /** + * Execute the row handler chain + */ + public RowHandlerExecutionChain rowHandlerExecutionChain; + + /** + * Execute the cell handler chain + */ + public CellHandlerExecutionChain cellHandlerExecutionChain; + public AbstractWriteHolder(WriteBasicParameter writeBasicParameter, AbstractWriteHolder parentAbstractWriteHolder) { super(writeBasicParameter, parentAbstractWriteHolder); @@ -169,7 +200,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ this.excelWriteHeadProperty = new ExcelWriteHeadProperty(this, getClazz(), getHead()); // Set writeHandlerMap - List handlerList = new ArrayList(); + List handlerList = new ArrayList<>(); // Initialization Annotation initAnnotationConfig(handlerList, writeBasicParameter); @@ -178,16 +209,16 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ && !writeBasicParameter.getCustomWriteHandlerList().isEmpty()) { handlerList.addAll(writeBasicParameter.getCustomWriteHandlerList()); } + sortAndClearUpHandler(handlerList, true); - this.ownWriteHandlerMap = sortAndClearUpHandler(handlerList); - - Map, List> parentWriteHandlerMap = null; if (parentAbstractWriteHolder != null) { - parentWriteHandlerMap = parentAbstractWriteHolder.getWriteHandlerMap(); + if (CollectionUtils.isNotEmpty(parentAbstractWriteHolder.getWriteHandlerList())) { + handlerList.addAll(parentAbstractWriteHolder.getWriteHandlerList()); + } } else { handlerList.addAll(DefaultWriteHandlerLoader.loadDefaultHandler(useDefaultStyle)); } - this.writeHandlerMap = sortAndClearUpAllHandler(handlerList, parentWriteHandlerMap); + sortAndClearUpHandler(handlerList, false); // Set converterMap if (parentAbstractWriteHolder == null) { @@ -229,7 +260,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } //if (hasStyle) { - dealStyle(handlerList); + dealStyle(handlerList); //} dealRowHigh(handlerList); @@ -310,38 +341,22 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ handlerList.add(columnWidthStyleStrategy); } - protected Map, List> sortAndClearUpAllHandler( - List handlerList, Map, List> parentHandlerMap) { - // add - if (parentHandlerMap != null) { - List parentWriteHandler = parentHandlerMap.get(WriteHandler.class); - if (!CollectionUtils.isEmpty(parentWriteHandler)) { - handlerList.addAll(parentWriteHandler); - } - } - return sortAndClearUpHandler(handlerList); - } - - protected Map, List> sortAndClearUpHandler( - List handlerList) { + protected void sortAndClearUpHandler(List handlerList, boolean runOwn) { // sort - Map> orderExcelWriteHandlerMap = new TreeMap>(); + Map> orderExcelWriteHandlerMap = new TreeMap<>(); for (WriteHandler handler : handlerList) { - int order = Integer.MIN_VALUE; - if (handler instanceof Order) { - order = ((Order)handler).order(); - } + int order = handler.order(); if (orderExcelWriteHandlerMap.containsKey(order)) { orderExcelWriteHandlerMap.get(order).add(handler); } else { - List tempHandlerList = new ArrayList(); + List tempHandlerList = new ArrayList<>(); tempHandlerList.add(handler); orderExcelWriteHandlerMap.put(order, tempHandlerList); } } // clean up - Set alreadyExistedHandlerSet = new HashSet(); - List cleanUpHandlerList = new ArrayList(); + Set alreadyExistedHandlerSet = new HashSet<>(); + List cleanUpHandlerList = new ArrayList<>(); for (Map.Entry> entry : orderExcelWriteHandlerMap.entrySet()) { for (WriteHandler handler : entry.getValue()) { if (handler instanceof NotRepeatExecutor) { @@ -354,30 +369,74 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ cleanUpHandlerList.add(handler); } } - // classify - Map, List> result = - new HashMap, List>(16); - result.put(WriteHandler.class, new ArrayList()); - result.put(WorkbookWriteHandler.class, new ArrayList()); - result.put(SheetWriteHandler.class, new ArrayList()); - result.put(RowWriteHandler.class, new ArrayList()); - result.put(CellWriteHandler.class, new ArrayList()); + + // build chain + if (!runOwn) { + this.writeHandlerList = new ArrayList<>(); + } for (WriteHandler writeHandler : cleanUpHandlerList) { - if (writeHandler instanceof CellWriteHandler) { - result.get(CellWriteHandler.class).add(writeHandler); + buildChain(writeHandler, runOwn); + } + } + + protected void buildChain(WriteHandler writeHandler, boolean runOwn) { + if (writeHandler instanceof CellWriteHandler) { + if (!runOwn) { + if (cellHandlerExecutionChain == null) { + cellHandlerExecutionChain = new CellHandlerExecutionChain((CellWriteHandler)writeHandler); + } else { + cellHandlerExecutionChain.addLast((CellWriteHandler)writeHandler); + } + this.writeHandlerList.add(writeHandler); } - if (writeHandler instanceof RowWriteHandler) { - result.get(RowWriteHandler.class).add(writeHandler); + return; + } + if (writeHandler instanceof RowWriteHandler) { + if (!runOwn) { + if (rowHandlerExecutionChain == null) { + rowHandlerExecutionChain = new RowHandlerExecutionChain((RowWriteHandler)writeHandler); + } else { + rowHandlerExecutionChain.addLast((RowWriteHandler)writeHandler); + } + this.writeHandlerList.add(writeHandler); } - if (writeHandler instanceof SheetWriteHandler) { - result.get(SheetWriteHandler.class).add(writeHandler); + return; + } + if (writeHandler instanceof SheetWriteHandler) { + if (!runOwn) { + if (sheetHandlerExecutionChain == null) { + sheetHandlerExecutionChain = new SheetHandlerExecutionChain((SheetWriteHandler)writeHandler); + } else { + sheetHandlerExecutionChain.addLast((SheetWriteHandler)writeHandler); + } + this.writeHandlerList.add(writeHandler); + } else { + if (ownSheetHandlerExecutionChain == null) { + ownSheetHandlerExecutionChain = new SheetHandlerExecutionChain((SheetWriteHandler)writeHandler); + } else { + ownSheetHandlerExecutionChain.addLast((SheetWriteHandler)writeHandler); + } } - if (writeHandler instanceof WorkbookWriteHandler) { - result.get(WorkbookWriteHandler.class).add(writeHandler); + return; + } + if (writeHandler instanceof WorkbookWriteHandler) { + if (!runOwn) { + if (workbookHandlerExecutionChain == null) { + workbookHandlerExecutionChain = new WorkbookHandlerExecutionChain( + (WorkbookWriteHandler)writeHandler); + } else { + workbookHandlerExecutionChain.addLast((WorkbookWriteHandler)writeHandler); + } + this.writeHandlerList.add(writeHandler); + } else { + if (ownWorkbookHandlerExecutionChain == null) { + ownWorkbookHandlerExecutionChain = new WorkbookHandlerExecutionChain( + (WorkbookWriteHandler)writeHandler); + } else { + ownWorkbookHandlerExecutionChain.addLast((WorkbookWriteHandler)writeHandler); + } } - result.get(WriteHandler.class).add(writeHandler); } - return result; } @Override @@ -406,16 +465,6 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ return getExcelWriteHeadProperty(); } - @Override - public Map, List> writeHandlerMap() { - return getWriteHandlerMap(); - } - - @Override - public Map, List> ownWriteHandlerMap() { - return getOwnWriteHandlerMap(); - } - @Override public boolean needHead() { return getNeedHead(); diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteHolder.java index 4896b034..77f3c14f 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteHolder.java @@ -1,10 +1,6 @@ package com.alibaba.excel.write.metadata.holder; -import java.util.List; -import java.util.Map; - import com.alibaba.excel.metadata.ConfigurationHolder; -import com.alibaba.excel.write.handler.WriteHandler; import com.alibaba.excel.write.property.ExcelWriteHeadProperty; /** @@ -21,20 +17,6 @@ public interface WriteHolder extends ConfigurationHolder { */ ExcelWriteHeadProperty excelWriteHeadProperty(); - /** - * What handler does the currently operated cell need to execute - * - * @return - */ - Map, List> writeHandlerMap(); - - /** - * create your own write handler. - * - * @return - */ - Map, List> ownWriteHandlerMap(); - /** * Is to determine if a field needs to be ignored * diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java index ef619196..100e59a1 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java @@ -259,8 +259,6 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { if (writeCellStyle == null) { return originCellStyle; } - WriteCellStyle tempWriteCellStyle = new WriteCellStyle(); - WriteCellStyle.merge(writeCellStyle, tempWriteCellStyle); short styleIndex = -1; Font originFont = null; @@ -277,14 +275,17 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { Map cellStyleMap = cellStyleIndexMap.computeIfAbsent(styleIndex, key -> MapUtils.newHashMap()); - CellStyle cellStyle = cellStyleMap.get(tempWriteCellStyle); + CellStyle cellStyle = cellStyleMap.get(writeCellStyle); if (cellStyle != null) { return cellStyle; } if (log.isDebugEnabled()) { - log.info("create new style:{},{}", tempWriteCellStyle, originCellStyle); + log.info("create new style:{},{}", writeCellStyle, originCellStyle); } - cellStyle = StyleUtil.buildCellStyle(workbook, originCellStyle, writeCellStyle); + WriteCellStyle tempWriteCellStyle = new WriteCellStyle(); + WriteCellStyle.merge(writeCellStyle, tempWriteCellStyle); + + cellStyle = StyleUtil.buildCellStyle(workbook, originCellStyle, tempWriteCellStyle); Short dataFormat = createDataFormat(tempWriteCellStyle.getDataFormatData(), useCache); if (dataFormat != null) { cellStyle.setDataFormat(dataFormat); diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java index 3082362a..8c9badfe 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java @@ -8,6 +8,7 @@ import java.util.List; import com.alibaba.easyexcel.test.demo.write.DemoData; import com.alibaba.easyexcel.test.util.TestFileUtil; import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.util.PositionUtils; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; @@ -147,4 +148,20 @@ public class Lock2Test { Thread.sleep(500 * 1000); } + @Test + public void test335() throws Exception { + + + LOGGER.info("reslut:{}", PositionUtils.getCol("A10",null)); + LOGGER.info("reslut:{}", PositionUtils.getRow("A10")); + LOGGER.info("reslut:{}", PositionUtils.getCol("AB10",null)); + LOGGER.info("reslut:{}", PositionUtils.getRow("AB10")); + + //LOGGER.info("reslut:{}", PositionUtils2.getCol("A10",null)); + //LOGGER.info("reslut:{}", PositionUtils2.getRow("A10")); + //LOGGER.info("reslut:{}", PositionUtils2.getCol("AB10",null)); + //LOGGER.info("reslut:{}", PositionUtils2.getRow("AB10")); + } + + } From b9da1ade4474b5ab4f87707014a5018c2b48ce11 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 17:23:40 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BB=E5=86=99?= =?UTF-8?q?=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../holder/xlsx/XlsxReadWorkbookHolder.java | 2 + .../com/alibaba/excel/util/ClassUtils.java | 27 +++---- .../executor/ExcelWriteFillExecutor.java | 74 +++++++++---------- .../test/core/large/LargeDataTest.java | 3 +- 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java index 9415fed8..24ff8503 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java @@ -9,6 +9,7 @@ import com.alibaba.excel.metadata.data.DataFormatData; import com.alibaba.excel.read.metadata.ReadWorkbook; import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; import com.alibaba.excel.support.ExcelTypeEnum; +import com.alibaba.excel.util.MapUtils; import lombok.Data; import org.apache.poi.openxml4j.opc.OPCPackage; @@ -50,6 +51,7 @@ public class XlsxReadWorkbookHolder extends ReadWorkbookHolder { super(readWorkbook); this.saxParserFactoryName = readWorkbook.getXlsxSAXParserFactoryName(); setExcelType(ExcelTypeEnum.XLSX); + dataFormatDataCache = MapUtils.newHashMap(); } public DataFormatData dataFormatData(int dateFormatIndexInteger) { diff --git a/src/main/java/com/alibaba/excel/util/ClassUtils.java b/src/main/java/com/alibaba/excel/util/ClassUtils.java index 9020d56c..8c7dd6b4 100644 --- a/src/main/java/com/alibaba/excel/util/ClassUtils.java +++ b/src/main/java/com/alibaba/excel/util/ClassUtils.java @@ -31,6 +31,8 @@ import com.alibaba.excel.metadata.property.NumberFormatProperty; import com.alibaba.excel.metadata.property.StyleProperty; import com.alibaba.excel.write.metadata.holder.WriteHolder; +import lombok.AllArgsConstructor; +import lombok.Data; import net.sf.cglib.beans.BeanMap; /** @@ -51,7 +53,7 @@ public class ClassUtils { /** * The cache configuration information for each of the class */ - public static final Map CONTENT_CACHE = new ConcurrentHashMap<>(); + public static final Map CONTENT_CACHE = new ConcurrentHashMap<>(); /** * Calculate the configuration information for the class @@ -117,20 +119,8 @@ public class ClassUtils { } } - private static String buildKey(Class clazz, Class headClass, String fieldName) { - String key = ""; - if (clazz != null) { - key += clazz.getName(); - } - key += "-"; - if (headClass != null) { - key += headClass.getName(); - } - key += "-"; - if (fieldName != null) { - key += fieldName; - } - return key; + private static ContentPropertyKey buildKey(Class clazz, Class headClass, String fieldName) { + return new ContentPropertyKey(clazz, headClass, fieldName); } private static Map declaredFieldContentMap(Class clazz) { @@ -413,4 +403,11 @@ public class ClassUtils { } } + @Data + @AllArgsConstructor + public static class ContentPropertyKey { + private Class clazz; + private Class headClass; + private String fieldName; + } } diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java index 97b8928e..331c4989 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java @@ -7,6 +7,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.Set; @@ -31,6 +32,8 @@ import com.alibaba.excel.write.metadata.fill.FillConfig; import com.alibaba.excel.write.metadata.fill.FillWrapper; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; +import lombok.AllArgsConstructor; +import lombok.Data; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.hssf.usermodel.PoiUtils; import org.apache.poi.ss.usermodel.Cell; @@ -55,29 +58,30 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { /** * Fields to replace in the template */ - private final Map> templateAnalysisCache = MapUtils.newHashMap(); + private final Map> templateAnalysisCache = MapUtils.newHashMap(); /** * Collection fields to replace in the template */ - private final Map> templateCollectionAnalysisCache = MapUtils.newHashMap(); + private final Map> templateCollectionAnalysisCache = MapUtils.newHashMap(); /** * Style cache for collection fields */ - private final Map> collectionFieldStyleCache = MapUtils.newHashMap(); + private final Map> collectionFieldStyleCache + = MapUtils.newHashMap(); /** * Row height cache for collection */ - private final Map collectionRowHeightCache = MapUtils.newHashMap(); + private final Map collectionRowHeightCache = MapUtils.newHashMap(); /** * Last index cache for collection fields */ - private final Map> collectionLastIndexCache = MapUtils.newHashMap(); + private final Map> collectionLastIndexCache = MapUtils.newHashMap(); - private final Map relativeRowIndexMap = MapUtils.newHashMap(); + private final Map relativeRowIndexMap = MapUtils.newHashMap(); /** * The unique data encoding for this fill */ - private String currentUniqueDataFlag; + private UniqueDataFlagKey currentUniqueDataFlag; public ExcelWriteFillExecutor(WriteContext writeContext) { super(writeContext); @@ -161,15 +165,16 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { sheet.shiftRows(maxRowIndex + 1, lastRowIndex, number, true, false); // The current data is greater than unity rowindex increase - String tablePrefix = tablePrefix(currentUniqueDataFlag); - increaseRowIndex(templateAnalysisCache, number, maxRowIndex, tablePrefix); - increaseRowIndex(templateCollectionAnalysisCache, number, maxRowIndex, tablePrefix); + increaseRowIndex(templateAnalysisCache, number, maxRowIndex); + increaseRowIndex(templateCollectionAnalysisCache, number, maxRowIndex); } - private void increaseRowIndex(Map> templateAnalysisCache, int number, int maxRowIndex, - String tablePrefix) { - for (Map.Entry> entry : templateAnalysisCache.entrySet()) { - if (!tablePrefix.equals(tablePrefix(entry.getKey()))) { + private void increaseRowIndex(Map> templateAnalysisCache, int number, + int maxRowIndex) { + for (Map.Entry> entry : templateAnalysisCache.entrySet()) { + UniqueDataFlagKey uniqueDataFlagKey = entry.getKey(); + if (!Objects.equals(currentUniqueDataFlag.getSheetNo(), uniqueDataFlagKey.getSheetNo()) || !Objects.equals( + currentUniqueDataFlag.getSheetName(), uniqueDataFlagKey.getSheetName())) { continue; } for (AnalysisCell analysisCell : entry.getValue()) { @@ -191,7 +196,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } else { dataMap = BeanMapUtils.create(oneRowData); } - Set dataKeySet = new HashSet(dataMap.keySet()); + Set dataKeySet = new HashSet<>(dataMap.keySet()); for (AnalysisCell analysisCell : analysisCellList) { CellWriteHandlerContext cellWriteHandlerContext = WriteHandlerUtils.createCellWriteHandlerContext( @@ -337,8 +342,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { throw new ExcelGenerateException("The wrong direction."); } - Row row = createRowIfNecessary(sheet, cachedSheet, lastRowIndex, fillConfig, analysisCell, isOriginalCell, - cellWriteHandlerContext); + Row row = createRowIfNecessary(sheet, cachedSheet, lastRowIndex, fillConfig, analysisCell, isOriginalCell); cellWriteHandlerContext.setRow(row); cellWriteHandlerContext.setRowIndex(lastRowIndex); @@ -368,7 +372,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } private Row createRowIfNecessary(Sheet sheet, Sheet cachedSheet, Integer lastRowIndex, FillConfig fillConfig, - AnalysisCell analysisCell, boolean isOriginalCell, CellWriteHandlerContext cellWriteHandlerContext) { + AnalysisCell analysisCell, boolean isOriginalCell) { Row row = sheet.getRow(lastRowIndex); if (row != null) { checkRowHeight(analysisCell, fillConfig, isOriginalCell, row); @@ -419,13 +423,13 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } } - private List readTemplateData(Map> analysisCache) { + private List readTemplateData(Map> analysisCache) { List analysisCellList = analysisCache.get(currentUniqueDataFlag); if (analysisCellList != null) { return analysisCellList; } Sheet sheet = writeContext.writeSheetHolder().getCachedSheet(); - Map> firstRowCache = MapUtils.newHashMapWithExpectedSize(8); + Map> firstRowCache = MapUtils.newHashMapWithExpectedSize(8); for (int i = 0; i <= sheet.getLastRowNum(); i++) { Row row = sheet.getRow(i); if (row == null) { @@ -455,7 +459,8 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { * @param firstRowCache first row cache * @return Returns the data that the cell needs to replace */ - private String prepareData(Cell cell, int rowIndex, int columnIndex, Map> firstRowCache) { + private String prepareData(Cell cell, int rowIndex, int columnIndex, + Map> firstRowCache) { if (!CellType.STRING.equals(cell.getCellType())) { return null; } @@ -538,7 +543,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } private String dealAnalysisCell(AnalysisCell analysisCell, String value, int rowIndex, int lastPrepareDataIndex, - int length, Map> firstRowCache, StringBuilder preparedData) { + int length, Map> firstRowCache, StringBuilder preparedData) { if (analysisCell != null) { if (lastPrepareDataIndex == length) { analysisCell.getPrepareDataList().add(StringUtils.EMPTY); @@ -546,7 +551,8 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { analysisCell.getPrepareDataList().add(convertPrepareData(value.substring(lastPrepareDataIndex))); analysisCell.setOnlyOneVariable(Boolean.FALSE); } - String uniqueDataFlag = uniqueDataFlag(writeContext.writeSheetHolder(), analysisCell.getPrefix()); + UniqueDataFlagKey uniqueDataFlag = uniqueDataFlag(writeContext.writeSheetHolder(), + analysisCell.getPrefix()); if (WriteTemplateAnalysisCellTypeEnum.COMMON.equals(analysisCell.getCellType())) { List analysisCellList = templateAnalysisCache.computeIfAbsent(uniqueDataFlag, key -> ListUtils.newArrayList()); @@ -590,21 +596,15 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { return prepareData; } - private String uniqueDataFlag(WriteSheetHolder writeSheetHolder, String wrapperName) { - String prefix; - if (writeSheetHolder.getSheetNo() != null) { - prefix = writeSheetHolder.getSheetNo().toString(); - } else { - prefix = writeSheetHolder.getSheetName(); - } - if (StringUtils.isEmpty(wrapperName)) { - return prefix + "-"; - } - return prefix + "-" + wrapperName; + private UniqueDataFlagKey uniqueDataFlag(WriteSheetHolder writeSheetHolder, String wrapperName) { + return new UniqueDataFlagKey(writeSheetHolder.getSheetNo(), writeSheetHolder.getSheetName(), wrapperName); } - private String tablePrefix(String uniqueDataFlag) { - return uniqueDataFlag.substring(0, uniqueDataFlag.indexOf("-") + 1); + @Data + @AllArgsConstructor + public static class UniqueDataFlagKey { + private Integer sheetNo; + private String sheetName; + private String wrapperName; } - } diff --git a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java index 3da8500d..c34990fc 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java @@ -46,7 +46,8 @@ public class LargeDataTest { } @Test - public void t01Read() { + public void t01Read() throws Exception{ + Thread.sleep(10*1000L); long start = System.currentTimeMillis(); EasyExcel.read(TestFileUtil.getPath() + "large" + File.separator + "large07.xlsx", LargeData.class, new LargeDataListener()).headRowNumber(2).sheet().doRead(); From 059bb9bfb7f4108f77ce07108a54fffbb70a34c0 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 17:29:35 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BB=E5=86=99?= =?UTF-8?q?=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/analysis/v07/XlsxSaxAnalyser.java | 6 ++-- .../holder/xlsx/XlsxReadSheetHolder.java | 35 ++----------------- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java b/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java index 329f5250..ea8b87b1 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java @@ -86,9 +86,9 @@ public class XlsxSaxAnalyser implements ExcelReadExecutor { // set style table setStylesTable(xlsxReadWorkbookHolder, xssfReader); - sheetList = new ArrayList(); - sheetMap = new HashMap(); - commentsTableMap = new HashMap(); + sheetList = new ArrayList<>(); + sheetMap = new HashMap<>(); + commentsTableMap = new HashMap<>(); XSSFReader.SheetIterator ite = (XSSFReader.SheetIterator)xssfReader.getSheetsData(); int index = 0; if (!ite.hasNext()) { diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java index 46b92818..b29ba455 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java @@ -7,11 +7,14 @@ import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.holder.ReadSheetHolder; import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; +import lombok.Data; + /** * sheet holder * * @author Jiaju Zhuang */ +@Data public class XlsxReadSheetHolder extends ReadSheetHolder { /** * Record the label of the current operation to prevent NPE. @@ -34,36 +37,4 @@ public class XlsxReadSheetHolder extends ReadSheetHolder { super(readSheet, readWorkbookHolder); this.tagDeque = new LinkedList(); } - - public Deque getTagDeque() { - return tagDeque; - } - - public void setTagDeque(Deque tagDeque) { - this.tagDeque = tagDeque; - } - - public Integer getColumnIndex() { - return columnIndex; - } - - public void setColumnIndex(Integer columnIndex) { - this.columnIndex = columnIndex; - } - - public StringBuilder getTempData() { - return tempData; - } - - public void setTempData(StringBuilder tempData) { - this.tempData = tempData; - } - - public StringBuilder getTempFormula() { - return tempFormula; - } - - public void setTempFormula(StringBuilder tempFormula) { - this.tempFormula = tempFormula; - } } From e33afa6c0fc19fd564003c8401adddb3eacd4b89 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 19:22:19 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BB=E5=86=99?= =?UTF-8?q?=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- img/readme/large.png | Bin 5424 -> 58751 bytes pom.xml | 2 +- .../excel/metadata/format/DataFormatter.java | 5 +++-- .../test/core/large/LargeDataTest.java | 19 +++++++++++++----- update.md | 2 +- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 660af477..f0ce3ad6 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ EasyExcel # JAVA解析Excel工具EasyExcel Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及解压后存储都是在内存中完成的,内存消耗依然很大。easyexcel重写了poi对07版Excel的解析,一个3M的excel用POI sax解析依然需要100M左右内存,改用easyexcel可以降低到几M,并且再大的excel也不会出现内存溢出;03版依赖POI的sax模式,在上层做了模型转换的封装,让使用者更加简单方便 -## 64M内存1分钟内读取75M(46W行25列)的Excel +## 64M内存20秒内读取75M(46W行25列)的Excel(3.0.2+版本) 当然还有极速模式能更快,但是内存占用会在100M多一点 ![img](img/readme/large.png) @@ -41,7 +41,7 @@ Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都 com.alibaba easyexcel - 3.0.1 + 3.0.2 ``` diff --git a/img/readme/large.png b/img/readme/large.png index 04195a10bfef90fc51c71d2bcb55cd654710461e..48223c56939bf8ccd0b96b906d978d3769dd129a 100644 GIT binary patch literal 58751 zcmYJaWmp_t6D>LroDd+mOYq?CHn_XH+u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q((|UO#Cebblk(7Qyztan~Phoy024ZF&nyQ-$b7$p>#mC%-*_^DGYsJ?(jK z%e+`@{<|o8ir^m9D%P)#8*;m2iPW)11*P6hC1X#UzVC3Rj3Rb?@hBtcXRSwka4|?1 zemkZwvj%=EiXDsjoBT*X7k+@FW2?391i*cWosgk627VNSo=f*nt=Qd=AuIzA$_ik_ z)5_;d6NOQlI9BDC;SFWMA1=?+Xe*b90_wZzDEa=e!wMUM9+x+kq>gve7E{DxImwc+ zAn{7EqHO}Zo}E}FJSE94ZB2W#@hM*kOL;_GY_yP@R674(o*ugm_`jnC{-H^FR@AB8 zX9BOTca;eoeoA=C*&Q{y_&s!E5tPo$bbY1zbk<$^xvKtm+w@eVE zc(H!WHS|7za6p9L5P2l_x5dj`v$hNfmpQ=^qn%+p>4Sb=+^6bajij+%WRY0wjDs+m zzm?N})(EiN0?*+d874WF+=yebNoTLaB&N26-b!vRO}Nyc@|3feb$FmRs{}wU(_>`i zOEt^uyF!ArrA#hjphe-vaZRfJ%rX=*{v5Aw6@#hg;(WcVULBH$VYTvc%C{>0hz)#H z@t=v9B-CS~BCHSG+>8A-c?mWf2I_&b&A9Pq!yR%HiA)f>O>{R^!QfZd&3}&i($c;r zwSYklxEH<-7kog(nJLa;lP3$z5AO;^2wkt&RG!St3?8_bU}L*5ib0az>p#_Sd1B*g z_Rse9XTe>?|LWl2>uNM(x6)F76cKqeR?6t|Y$>TwN%tN4T(TS*?biM>QAoB93s}+b-?wj#Q~bTs=QrCX&IL qY!f^PL3OMl{27)+CIJOAB~EVVFdmF;6vJOI0$S?&YPG7*BmNI#cvTqy diff --git a/pom.xml b/pom.xml index 66331d1b..00bae497 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.alibaba easyexcel - 3.0.1 + 3.0.2 jar easyexcel diff --git a/src/main/java/com/alibaba/excel/metadata/format/DataFormatter.java b/src/main/java/com/alibaba/excel/metadata/format/DataFormatter.java index bf76404f..ba8fee47 100644 --- a/src/main/java/com/alibaba/excel/metadata/format/DataFormatter.java +++ b/src/main/java/com/alibaba/excel/metadata/format/DataFormatter.java @@ -111,6 +111,8 @@ public class DataFormatter { */ private static final Pattern alternateGrouping = Pattern.compile("([#0]([^.#0])[#0]{3})"); + private static final Pattern E_NOTATION_PATTERN = Pattern.compile("E(\\d)"); + /** * Cells formatted with a date or time format and which contain invalid date or time values show 255 pound signs * ("#"). @@ -644,8 +646,7 @@ public class DataFormatter { */ private String getFormattedNumberString(BigDecimal data, Short dataFormat, String dataFormatString) { Format numberFormat = getFormat(data.doubleValue(), dataFormat, dataFormatString); - String formatted = numberFormat.format(data); - return formatted.replaceFirst("E(\\d)", "E+$1"); // to match Excel's E-notation + return E_NOTATION_PATTERN.matcher(numberFormat.format(data)).replaceFirst("E+$1"); } /** diff --git a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java index c34990fc..a438a2ee 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java @@ -32,6 +32,7 @@ public class LargeDataTest { private static File template07; private static File fileCsv; private static File fileWrite07; + private static File fileWriteTemp07; private static File fileWritePoi07; private int i = 0; @@ -40,14 +41,14 @@ public class LargeDataTest { public static void init() { fileFill07 = TestFileUtil.createNewFile("largefill07.xlsx"); fileWrite07 = TestFileUtil.createNewFile("large" + File.separator + "fileWrite07.xlsx"); + fileWriteTemp07 = TestFileUtil.createNewFile("large" + File.separator + "fileWriteTemp07.xlsx"); fileWritePoi07 = TestFileUtil.createNewFile("large" + File.separator + "fileWritePoi07.xlsx"); template07 = TestFileUtil.readFile("large" + File.separator + "fill.xlsx"); fileCsv = TestFileUtil.createNewFile("largefileCsv.csv"); } @Test - public void t01Read() throws Exception{ - Thread.sleep(10*1000L); + public void t01Read() throws Exception { long start = System.currentTimeMillis(); EasyExcel.read(TestFileUtil.getPath() + "large" + File.separator + "large07.xlsx", LargeData.class, new LargeDataListener()).headRowNumber(2).sheet().doRead(); @@ -86,9 +87,16 @@ public class LargeDataTest { @Test public void t04Write() throws Exception { - long start = System.currentTimeMillis(); - ExcelWriter excelWriter = EasyExcel.write(fileWrite07, LargeData.class).build(); + ExcelWriter excelWriter = EasyExcel.write(fileWriteTemp07, LargeData.class).build(); WriteSheet writeSheet = EasyExcel.writerSheet().build(); + for (int j = 0; j < 2; j++) { + excelWriter.write(data(), writeSheet); + } + excelWriter.finish(); + + long start = System.currentTimeMillis(); + excelWriter = EasyExcel.write(fileWrite07, LargeData.class).build(); + writeSheet = EasyExcel.writerSheet().build(); for (int j = 0; j < 100; j++) { excelWriter.write(data(), writeSheet); LOGGER.info("{} write success.", j); @@ -116,7 +124,8 @@ public class LargeDataTest { } long costPoi = System.currentTimeMillis() - start; LOGGER.info("poi write cost:{}", System.currentTimeMillis() - start); - Assert.assertTrue(costPoi * 3 > cost); + LOGGER.info("{} vs {}", cost, costPoi); + Assert.assertTrue(costPoi * 2 > cost); } private List data() { diff --git a/update.md b/update.md index 6cc837de..5d1f724c 100644 --- a/update.md +++ b/update.md @@ -1,5 +1,5 @@ # 3.0.2 -* 修复写入的性能问题 +* 大幅提升读写性能 # 3.0.1 * 升级到正式版 From 89c750aa57821197e7892234091e7350092c3374 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 19:31:26 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9style=20=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=A9=BA=E6=8C=87=E9=92=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/alibaba/excel/util/StyleUtil.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/util/StyleUtil.java b/src/main/java/com/alibaba/excel/util/StyleUtil.java index 1bafcdc8..e8a503d7 100644 --- a/src/main/java/com/alibaba/excel/util/StyleUtil.java +++ b/src/main/java/com/alibaba/excel/util/StyleUtil.java @@ -1,5 +1,7 @@ package com.alibaba.excel.util; +import java.util.Optional; + import com.alibaba.excel.constant.BuiltinFormats; import com.alibaba.excel.metadata.data.DataFormatData; import com.alibaba.excel.metadata.data.HyperlinkData; @@ -189,7 +191,11 @@ public class StyleUtil { xssfFont.setStrikeout(xssfOriginFont.getStrikeout()); // Colors cannot be overwritten if (writeFont == null || writeFont.getColor() == null) { - xssfFont.setColor(new XSSFColor(xssfOriginFont.getXSSFColor().getRGB(), null)); + xssfFont.setColor(Optional.of(xssfOriginFont) + .map(XSSFFont::getXSSFColor) + .map(XSSFColor::getRGB) + .map(rgb -> new XSSFColor(rgb, null)) + .orElse(null)); } xssfFont.setTypeOffset(xssfOriginFont.getTypeOffset()); xssfFont.setUnderline(xssfOriginFont.getUnderline()); From 6366552137eaf5bba270508b30c22920860e68af Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 20:03:59 +0800 Subject: [PATCH 09/12] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D=E5=88=97=E5=AE=BD?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E6=B2=A1=E7=94=A8=E7=9A=84bug=20[Issue=20#21?= =?UTF-8?q?51]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metadata/holder/AbstractWriteHolder.java | 7 ------- .../property/ExcelWriteHeadProperty.java | 11 +++++++++++ .../test/core/annotation/AnnotationData.java | 8 +++++--- .../core/annotation/AnnotationDataTest.java | 19 +++++++++++++++++++ .../test/core/style/StyleDataTest.java | 4 ++++ 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java index cc4b2f21..ca14886c 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java @@ -243,15 +243,11 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } Map headMap = getExcelWriteHeadProperty().getHeadMap(); boolean hasColumnWidth = false; - boolean hasStyle = false; for (Head head : headMap.values()) { if (head.getColumnWidthProperty() != null) { hasColumnWidth = true; } - if (head.getHeadStyleProperty() != null || head.getHeadFontProperty() != null) { - hasStyle = true; - } dealLoopMerge(handlerList, head); } @@ -259,10 +255,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ dealColumnWidth(handlerList); } - //if (hasStyle) { dealStyle(handlerList); - //} - dealRowHigh(handlerList); dealOnceAbsoluteMerge(handlerList); } diff --git a/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java b/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java index 7f52cd1d..84ba05a5 100644 --- a/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java +++ b/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentLoopMerge; import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.annotation.write.style.HeadFontStyle; @@ -17,6 +18,7 @@ import com.alibaba.excel.enums.HeadKindEnum; import com.alibaba.excel.metadata.CellRange; import com.alibaba.excel.metadata.Head; import com.alibaba.excel.metadata.Holder; +import com.alibaba.excel.metadata.property.ColumnWidthProperty; import com.alibaba.excel.metadata.property.ExcelHeadProperty; import com.alibaba.excel.metadata.property.FontProperty; import com.alibaba.excel.metadata.property.LoopMergeProperty; @@ -50,9 +52,11 @@ public class ExcelWriteHeadProperty extends ExcelHeadProperty { this.onceAbsoluteMergeProperty = OnceAbsoluteMergeProperty.build(headClazz.getAnnotation(OnceAbsoluteMerge.class)); + ColumnWidth parentColumnWidth = headClazz.getAnnotation(ColumnWidth.class); HeadStyle parentHeadStyle = headClazz.getAnnotation(HeadStyle.class); HeadFontStyle parentHeadFontStyle = headClazz.getAnnotation(HeadFontStyle.class); + for (Map.Entry entry : getHeadMap().entrySet()) { Head headData = entry.getValue(); if (headData == null) { @@ -61,6 +65,13 @@ public class ExcelWriteHeadProperty extends ExcelHeadProperty { } Field field = headData.getField(); + ColumnWidth columnWidth = field.getAnnotation(ColumnWidth.class); + if (columnWidth == null) { + columnWidth = parentColumnWidth; + } + headData.setColumnWidthProperty(ColumnWidthProperty.build(columnWidth)); + + HeadStyle headStyle = field.getAnnotation(HeadStyle.class); if (headStyle == null) { headStyle = parentHeadStyle; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java index d1c2a4f7..40bc4b0b 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java @@ -16,16 +16,18 @@ import lombok.Data; * @author Jiaju Zhuang */ @Data -@ColumnWidth(30) -@HeadRowHeight(15) -@ContentRowHeight(20) +@ColumnWidth(50) +@HeadRowHeight(50) +@ContentRowHeight(100) public class AnnotationData { @ExcelProperty("日期") @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒") private Date date; + @ExcelProperty(value = "数字") @NumberFormat("#.##%") private Double number; + @ExcelIgnore private String ignore; private static final String staticFinal = "test"; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java index 7a4dfe21..02bd3159 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java @@ -8,6 +8,11 @@ import com.alibaba.easyexcel.test.util.TestFileUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.util.DateUtils; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -46,6 +51,20 @@ public class AnnotationDataTest { EasyExcel.write().file(file).head(AnnotationData.class).sheet().doWrite(data()); EasyExcel.read().file(file).head(AnnotationData.class).registerReadListener(new AnnotationDataListener()) .sheet().doRead(); + + if (file == fileCsv) { + return; + } + + Workbook workbook = WorkbookFactory.create(file); + Sheet sheet = workbook.getSheetAt(0); + Assert.assertEquals(50 * 256, sheet.getColumnWidth(0), 0); + + Row row0 = sheet.getRow(0); + Assert.assertEquals(1000, row0.getHeight(), 0); + + Row row1 = sheet.getRow(1); + Assert.assertEquals(2000, row1.getHeight(), 0); } private List data() throws Exception { diff --git a/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java index a48c3238..e9323761 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java @@ -209,7 +209,10 @@ public class StyleDataTest { Workbook workbook = WorkbookFactory.create(file); Sheet sheet = workbook.getSheetAt(0); + Assert.assertEquals(50 * 256, sheet.getColumnWidth(0), 0); + Row row0 = sheet.getRow(0); + Assert.assertEquals(800, row0.getHeight(), 0); Cell cell00 = row0.getCell(0); Assert.assertArrayEquals(new byte[] {-1, -1, 0}, StyleTestUtils.getFillForegroundColor(cell00)); Assert.assertArrayEquals(new byte[] {-128, -128, 0}, StyleTestUtils.getFontColor(cell00, workbook)); @@ -221,6 +224,7 @@ public class StyleDataTest { Assert.assertEquals(20, StyleTestUtils.getFontHeightInPoints(cell01, workbook)); Row row1 = sheet.getRow(1); + Assert.assertEquals(1000, row1.getHeight(), 0); Cell cell10 = row1.getCell(0); Assert.assertArrayEquals(new byte[] {0, -128, -128}, StyleTestUtils.getFillForegroundColor(cell10)); Assert.assertArrayEquals(new byte[] {0, 51, 102}, StyleTestUtils.getFontColor(cell10, workbook)); From 3d419feee6386e633eef28ce71a1ce387aeb9123 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 20:04:02 +0800 Subject: [PATCH 10/12] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D=E5=88=97=E5=AE=BD?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E6=B2=A1=E7=94=A8=E7=9A=84bug=20[Issue=20#21?= =?UTF-8?q?51]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update.md | 1 + 1 file changed, 1 insertion(+) diff --git a/update.md b/update.md index 5d1f724c..0ac5c924 100644 --- a/update.md +++ b/update.md @@ -1,5 +1,6 @@ # 3.0.2 * 大幅提升读写性能 +* 修复列宽注解没用的bug [Issue #2151](https://github.com/alibaba/easyexcel/issues/2151) # 3.0.1 * 升级到正式版 From 6448d5aef5e2b8ef6a4b8ae704f676059ecff192 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 20:13:01 +0800 Subject: [PATCH 11/12] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D`CellData`=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E5=A4=B1=E8=B4=A5=E7=9A=84=E7=9A=84bug=20[Issue=20#21?= =?UTF-8?q?47]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/alibaba/excel/util/ConverterUtils.java | 3 ++- update.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/util/ConverterUtils.java b/src/main/java/com/alibaba/excel/util/ConverterUtils.java index 2a30c57c..02ea4a00 100644 --- a/src/main/java/com/alibaba/excel/util/ConverterUtils.java +++ b/src/main/java/com/alibaba/excel/util/ConverterUtils.java @@ -13,6 +13,7 @@ import com.alibaba.excel.converters.NullableObjectConverter; import com.alibaba.excel.converters.ReadConverterContext; import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.exception.ExcelDataConvertException; +import com.alibaba.excel.metadata.data.CellData; import com.alibaba.excel.metadata.data.ReadCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.read.metadata.holder.ReadSheetHolder; @@ -89,7 +90,7 @@ public class ConverterUtils { } else { clazz = field.getType(); } - if (clazz == ReadCellData.class) { + if (clazz == CellData.class || clazz == ReadCellData.class) { Class classGeneric = getClassGeneric(field.getGenericType()); ReadCellData cellDataReturn = cellData.clone(); cellDataReturn.setData(doConvertToJavaObject(cellData, classGeneric, contentProperty, converterMap, diff --git a/update.md b/update.md index 0ac5c924..f1f90470 100644 --- a/update.md +++ b/update.md @@ -1,6 +1,8 @@ # 3.0.2 * 大幅提升读写性能 * 修复列宽注解没用的bug [Issue #2151](https://github.com/alibaba/easyexcel/issues/2151) +* 修复`CellData`接收失败的的bug [Issue #2147](https://github.com/alibaba/easyexcel/issues/2147) + # 3.0.1 * 升级到正式版 From 7bd8caa559fdd1dce0e3fc5bc38f170480c0b2d4 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 21:29:33 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/converters/ConverterKeyBuild.java | 18 +++++++++++------- .../excel/converters/ReadConverterContext.java | 8 ++++++-- .../converters/WriteConverterContext.java | 8 ++++++-- .../exception/ExcelDataConvertException.java | 8 ++++++-- .../ExcelWriteDataConvertException.java | 8 ++++++-- .../alibaba/excel/metadata/AbstractCell.java | 8 ++++++-- .../alibaba/excel/metadata/AbstractHolder.java | 8 ++++++-- .../alibaba/excel/metadata/BasicParameter.java | 8 ++++++-- .../com/alibaba/excel/metadata/CellRange.java | 8 ++++++-- .../excel/metadata/GlobalConfiguration.java | 8 ++++++-- .../java/com/alibaba/excel/metadata/Head.java | 8 ++++++-- .../alibaba/excel/metadata/csv/CsvCell.java | 6 ++++-- .../excel/metadata/csv/CsvCellStyle.java | 8 ++++++-- .../com/alibaba/excel/metadata/csv/CsvRow.java | 8 ++++++-- .../alibaba/excel/metadata/csv/CsvSheet.java | 8 ++++++-- .../excel/metadata/csv/CsvWorkbook.java | 8 ++++++-- .../alibaba/excel/metadata/data/CellData.java | 8 ++++++-- .../excel/metadata/data/ClientAnchorData.java | 7 +++++-- .../excel/metadata/data/CommentData.java | 8 ++++++-- .../excel/metadata/data/CoordinateData.java | 8 ++++++-- .../excel/metadata/data/DataFormatData.java | 8 ++++++-- .../excel/metadata/data/FormulaData.java | 8 ++++++-- .../excel/metadata/data/HyperlinkData.java | 7 +++++-- .../alibaba/excel/metadata/data/ImageData.java | 7 +++++-- .../excel/metadata/data/ReadCellData.java | 8 ++++++-- .../metadata/data/RichTextStringData.java | 12 +++++++++--- .../excel/metadata/data/WriteCellData.java | 8 ++++++-- .../property/DateTimeFormatProperty.java | 8 ++++++-- .../property/ExcelContentProperty.java | 8 ++++++-- .../metadata/property/ExcelHeadProperty.java | 8 ++++++-- .../excel/metadata/property/FontProperty.java | 8 ++++++-- .../excel/metadata/property/StyleProperty.java | 8 ++++++-- .../read/metadata/ReadBasicParameter.java | 8 ++++++-- .../excel/read/metadata/ReadWorkbook.java | 8 ++++++-- .../metadata/holder/AbstractReadHolder.java | 8 ++++++-- .../read/metadata/holder/ReadSheetHolder.java | 8 ++++++-- .../metadata/holder/ReadWorkbookHolder.java | 8 ++++++-- .../holder/csv/CsvReadSheetHolder.java | 8 ++++++-- .../holder/csv/CsvReadWorkbookHolder.java | 8 ++++++-- .../holder/xlsx/XlsxReadSheetHolder.java | 8 ++++++-- .../holder/xlsx/XlsxReadWorkbookHolder.java | 8 ++++++-- .../com/alibaba/excel/util/ClassUtils.java | 8 ++++++-- .../write/executor/ExcelWriteFillExecutor.java | 9 +++++++-- .../chain/CellHandlerExecutionChain.java | 8 ++++++-- .../chain/RowHandlerExecutionChain.java | 8 ++++++-- .../chain/SheetHandlerExecutionChain.java | 8 ++++++-- .../chain/WorkbookHandlerExecutionChain.java | 8 ++++++-- .../context/CellWriteHandlerContext.java | 8 ++++++-- .../context/RowWriteHandlerContext.java | 8 ++++++-- .../context/SheetWriteHandlerContext.java | 8 ++++++-- .../context/WorkbookWriteHandlerContext.java | 8 ++++++-- .../write/metadata/WriteBasicParameter.java | 8 ++++++-- .../excel/write/metadata/WriteSheet.java | 8 ++++++-- .../excel/write/metadata/WriteTable.java | 8 ++++++-- .../excel/write/metadata/WriteWorkbook.java | 8 ++++++-- .../write/metadata/fill/AnalysisCell.java | 8 ++++++-- .../excel/write/metadata/fill/FillConfig.java | 8 ++++++-- .../metadata/holder/AbstractWriteHolder.java | 18 +++++++++--------- .../metadata/holder/WriteSheetHolder.java | 8 ++++++-- .../metadata/holder/WriteTableHolder.java | 8 ++++++-- .../metadata/holder/WriteWorkbookHolder.java | 10 ++++++++-- .../write/metadata/style/WriteCellStyle.java | 8 ++++++-- .../excel/write/metadata/style/WriteFont.java | 8 ++++++-- .../write/property/ExcelWriteHeadProperty.java | 8 ++++++-- .../style/HorizontalCellStyleStrategy.java | 8 ++++++-- .../test/core/annotation/AnnotationData.java | 8 ++++++-- .../annotation/AnnotationIndexAndNameData.java | 8 ++++++-- .../test/core/celldata/CellDataReadData.java | 8 ++++++-- .../test/core/celldata/CellDataWriteData.java | 8 ++++++-- .../test/core/converter/ConverterReadData.java | 8 ++++++-- .../core/converter/ConverterWriteData.java | 8 ++++++-- .../test/core/converter/ImageData.java | 8 ++++++-- .../core/converter/ReadAllConverterData.java | 8 ++++++-- .../test/core/dataformat/DateFormatData.java | 8 ++++++-- .../test/core/encrypt/EncryptData.java | 8 ++++++-- .../test/core/exception/ExceptionData.java | 8 ++++++-- .../excludeorinclude/ExcludeOrIncludeData.java | 8 ++++++-- .../easyexcel/test/core/extra/ExtraData.java | 8 ++++++-- .../easyexcel/test/core/fill/FillData.java | 8 ++++++-- .../fill/style/FillStyleAnnotatedData.java | 8 ++++++-- .../test/core/fill/style/FillStyleData.java | 8 ++++++-- .../test/core/handler/WriteHandlerData.java | 8 ++++++-- .../test/core/head/ComplexHeadData.java | 8 ++++++-- .../easyexcel/test/core/head/NoHeadData.java | 8 ++++++-- .../easyexcel/test/core/large/LargeData.java | 8 ++++++-- .../multiplesheets/MultipleSheetsData.java | 8 ++++++-- .../test/core/noncamel/UnCamelData.java | 8 ++++++-- .../test/core/parameter/ParameterData.java | 8 ++++++-- .../test/core/repetition/RepetitionData.java | 8 ++++++-- .../easyexcel/test/core/simple/SimpleData.java | 8 ++++++-- .../easyexcel/test/core/skip/SkipData.java | 8 ++++++-- .../easyexcel/test/core/sort/SortData.java | 8 ++++++-- .../easyexcel/test/core/style/StyleData.java | 8 ++++++-- .../test/core/template/TemplateData.java | 8 ++++++-- .../easyexcel/test/demo/fill/FillData.java | 8 ++++++-- .../test/demo/read/CellDataReadDemoData.java | 8 ++++++-- .../test/demo/read/ConverterData.java | 8 ++++++-- .../easyexcel/test/demo/read/DemoData.java | 8 ++++++-- .../test/demo/read/DemoExtraData.java | 8 ++++++-- .../test/demo/read/ExceptionDemoData.java | 8 ++++++-- .../test/demo/read/IndexOrNameData.java | 8 ++++++-- .../easyexcel/test/demo/web/DownloadData.java | 8 ++++++-- .../easyexcel/test/demo/web/UploadData.java | 8 ++++++-- .../test/demo/write/ComplexHeadData.java | 8 ++++++-- .../test/demo/write/ConverterData.java | 8 ++++++-- .../easyexcel/test/demo/write/DemoData.java | 9 ++++++--- .../test/demo/write/DemoMergeData.java | 8 ++++++-- .../test/demo/write/DemoStyleData.java | 8 ++++++-- .../demo/write/ImageDataWithAnnotation.java | 8 ++++++-- .../test/demo/write/ImageDemoData.java | 8 ++++++-- .../easyexcel/test/demo/write/IndexData.java | 8 ++++++-- .../write/LongestMatchColumnWidthData.java | 8 ++++++-- .../test/demo/write/WidthAndHeightData.java | 8 ++++++-- .../test/demo/write/WriteCellDemoData.java | 8 ++++++-- .../alibaba/easyexcel/test/temp/CamlData.java | 8 ++++++-- .../alibaba/easyexcel/test/temp/LockData.java | 8 ++++++-- .../alibaba/easyexcel/test/temp/StyleData.java | 8 ++++++-- .../easyexcel/test/temp/TempFillData.java | 8 ++++++-- .../easyexcel/test/temp/bug/DataType.java | 9 +++++++-- .../easyexcel/test/temp/bug/HeadType.java | 9 +++++++-- .../easyexcel/test/temp/csv/CsvData.java | 8 ++++++-- .../easyexcel/test/temp/data/DataType.java | 8 ++++++-- .../easyexcel/test/temp/data/HeadType.java | 8 ++++++-- .../test/temp/dataformat/DataFormatData.java | 9 ++++++--- .../easyexcel/test/temp/fill/FillData2.java | 8 ++++++-- .../test/temp/issue1662/Data1662.java | 13 +++++++++---- .../test/temp/issue1663/FillData.java | 8 ++++++-- .../easyexcel/test/temp/large/LargeData.java | 8 ++++++-- .../easyexcel/test/temp/poi/TestCell.java | 8 ++++++-- .../easyexcel/test/temp/read/HeadReadData.java | 9 ++++++--- .../easyexcel/test/temp/simple/DemoData1.java | 8 ++++++-- .../easyexcel/test/temp/simple/DemoData2.java | 8 ++++++-- .../easyexcel/test/temp/simple/JsonData.java | 8 ++++++-- .../easyexcel/test/temp/simple/WriteData.java | 10 ++++++---- 134 files changed, 818 insertions(+), 288 deletions(-) diff --git a/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java b/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java index 5fe8f0bc..d6417be7 100644 --- a/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java +++ b/src/main/java/com/alibaba/excel/converters/ConverterKeyBuild.java @@ -6,7 +6,9 @@ import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.util.MapUtils; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Converter unique key.Consider that you can just use class as the key. @@ -29,18 +31,20 @@ public class ConverterKeyBuild { } public static ConverterKey buildKey(Class clazz) { - Class boxingClass = BOXING_MAP.get(clazz); - if (boxingClass != null) { - return new ConverterKey(boxingClass, null); - } - return new ConverterKey(clazz, null); + return buildKey(clazz, null); } public static ConverterKey buildKey(Class clazz, CellDataTypeEnum cellDataTypeEnum) { + Class boxingClass = BOXING_MAP.get(clazz); + if (boxingClass != null) { + return new ConverterKey(boxingClass, cellDataTypeEnum); + } return new ConverterKey(clazz, cellDataTypeEnum); } - @Data + @Getter + @Setter + @EqualsAndHashCode @AllArgsConstructor public static class ConverterKey { private Class clazz; diff --git a/src/main/java/com/alibaba/excel/converters/ReadConverterContext.java b/src/main/java/com/alibaba/excel/converters/ReadConverterContext.java index e1367065..9c7970cd 100644 --- a/src/main/java/com/alibaba/excel/converters/ReadConverterContext.java +++ b/src/main/java/com/alibaba/excel/converters/ReadConverterContext.java @@ -5,14 +5,18 @@ import com.alibaba.excel.metadata.data.ReadCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * read converter context * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @AllArgsConstructor public class ReadConverterContext { /** diff --git a/src/main/java/com/alibaba/excel/converters/WriteConverterContext.java b/src/main/java/com/alibaba/excel/converters/WriteConverterContext.java index cb01c773..46abda47 100644 --- a/src/main/java/com/alibaba/excel/converters/WriteConverterContext.java +++ b/src/main/java/com/alibaba/excel/converters/WriteConverterContext.java @@ -4,15 +4,19 @@ import com.alibaba.excel.context.WriteContext; import com.alibaba.excel.metadata.property.ExcelContentProperty; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * write converter context * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor @AllArgsConstructor public class WriteConverterContext { diff --git a/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java b/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java index 1e56a200..ff1b409d 100644 --- a/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java +++ b/src/main/java/com/alibaba/excel/exception/ExcelDataConvertException.java @@ -4,14 +4,18 @@ import com.alibaba.excel.metadata.data.CellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.write.builder.ExcelWriterBuilder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Data convert exception * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExcelDataConvertException extends RuntimeException { /** * NotNull. diff --git a/src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java b/src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java index 9f9a2e4a..b8e3fcb3 100644 --- a/src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java +++ b/src/main/java/com/alibaba/excel/exception/ExcelWriteDataConvertException.java @@ -2,14 +2,18 @@ package com.alibaba.excel.exception; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Data convert exception * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExcelWriteDataConvertException extends ExcelDataConvertException { /** * handler. diff --git a/src/main/java/com/alibaba/excel/metadata/AbstractCell.java b/src/main/java/com/alibaba/excel/metadata/AbstractCell.java index 6647cf0c..9650b303 100644 --- a/src/main/java/com/alibaba/excel/metadata/AbstractCell.java +++ b/src/main/java/com/alibaba/excel/metadata/AbstractCell.java @@ -1,13 +1,17 @@ package com.alibaba.excel.metadata; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * cell * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class AbstractCell implements Cell { /** * Row index diff --git a/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java b/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java index 828f38e7..839a8b4b 100644 --- a/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java +++ b/src/main/java/com/alibaba/excel/metadata/AbstractHolder.java @@ -6,15 +6,19 @@ import java.util.Map; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.converters.ConverterKeyBuild.ConverterKey; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * Write/read holder * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public abstract class AbstractHolder implements ConfigurationHolder { /** diff --git a/src/main/java/com/alibaba/excel/metadata/BasicParameter.java b/src/main/java/com/alibaba/excel/metadata/BasicParameter.java index f574f10e..0c11f942 100644 --- a/src/main/java/com/alibaba/excel/metadata/BasicParameter.java +++ b/src/main/java/com/alibaba/excel/metadata/BasicParameter.java @@ -5,14 +5,18 @@ import java.util.Locale; import com.alibaba.excel.converters.Converter; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Basic parameter * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class BasicParameter { /** * You can only choose one of the {@link BasicParameter#head} and {@link BasicParameter#clazz} diff --git a/src/main/java/com/alibaba/excel/metadata/CellRange.java b/src/main/java/com/alibaba/excel/metadata/CellRange.java index bd0f54f9..8552d09f 100644 --- a/src/main/java/com/alibaba/excel/metadata/CellRange.java +++ b/src/main/java/com/alibaba/excel/metadata/CellRange.java @@ -1,11 +1,15 @@ package com.alibaba.excel.metadata; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author jipengfei */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CellRange { private int firstRow; diff --git a/src/main/java/com/alibaba/excel/metadata/GlobalConfiguration.java b/src/main/java/com/alibaba/excel/metadata/GlobalConfiguration.java index 987e553b..5cafe90c 100644 --- a/src/main/java/com/alibaba/excel/metadata/GlobalConfiguration.java +++ b/src/main/java/com/alibaba/excel/metadata/GlobalConfiguration.java @@ -2,14 +2,18 @@ package com.alibaba.excel.metadata; import java.util.Locale; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Global configuration * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class GlobalConfiguration { /** * Automatic trim includes sheet name and content diff --git a/src/main/java/com/alibaba/excel/metadata/Head.java b/src/main/java/com/alibaba/excel/metadata/Head.java index 7e1fd47b..5aa1cc3a 100644 --- a/src/main/java/com/alibaba/excel/metadata/Head.java +++ b/src/main/java/com/alibaba/excel/metadata/Head.java @@ -10,14 +10,18 @@ import com.alibaba.excel.metadata.property.FontProperty; import com.alibaba.excel.metadata.property.LoopMergeProperty; import com.alibaba.excel.metadata.property.StyleProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * excel head * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class Head { /** * Column index of head diff --git a/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java b/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java index f0e925e6..72beb30a 100644 --- a/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java +++ b/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java @@ -10,7 +10,7 @@ import com.alibaba.excel.enums.NumericCellTypeEnum; import com.alibaba.excel.metadata.data.FormulaData; import lombok.AccessLevel; -import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.poi.ss.SpreadsheetVersion; @@ -29,7 +29,9 @@ import org.apache.poi.ss.util.CellRangeAddress; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvCell extends CellBase { /** diff --git a/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java b/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java index 08b46e3a..a992f213 100644 --- a/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java +++ b/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java @@ -2,7 +2,9 @@ package com.alibaba.excel.metadata.csv; import com.alibaba.excel.metadata.data.DataFormatData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Color; @@ -16,7 +18,9 @@ import org.apache.poi.ss.usermodel.VerticalAlignment; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvCellStyle implements CellStyle { /** diff --git a/src/main/java/com/alibaba/excel/metadata/csv/CsvRow.java b/src/main/java/com/alibaba/excel/metadata/csv/CsvRow.java index 24acd9d9..89e76a71 100644 --- a/src/main/java/com/alibaba/excel/metadata/csv/CsvRow.java +++ b/src/main/java/com/alibaba/excel/metadata/csv/CsvRow.java @@ -3,7 +3,9 @@ package com.alibaba.excel.metadata.csv; import java.util.Iterator; import java.util.List; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; import org.apache.poi.ss.usermodel.Cell; @@ -17,7 +19,9 @@ import org.apache.poi.ss.usermodel.Sheet; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvRow implements Row { /** diff --git a/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java b/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java index b002b6b4..79331677 100644 --- a/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java +++ b/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java @@ -16,7 +16,9 @@ import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.NumberDataFormatterUtils; import com.alibaba.excel.util.StringUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; import org.apache.poi.ss.usermodel.AutoFilter; @@ -45,7 +47,9 @@ import org.apache.poi.ss.util.PaneInformation; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvSheet implements Sheet, Closeable { /** * workbook diff --git a/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java b/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java index e26a2b65..4e713509 100644 --- a/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java +++ b/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java @@ -6,7 +6,9 @@ import java.util.Iterator; import java.util.List; import java.util.Locale; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.compress.utils.Lists; import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.formula.udf.UDFFinder; @@ -26,7 +28,9 @@ import org.apache.poi.ss.usermodel.Workbook; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvWorkbook implements Workbook { /** * output diff --git a/src/main/java/com/alibaba/excel/metadata/data/CellData.java b/src/main/java/com/alibaba/excel/metadata/data/CellData.java index ed6085f9..2f74ea9b 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/CellData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/CellData.java @@ -6,7 +6,9 @@ import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.metadata.AbstractCell; import com.alibaba.excel.util.StringUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Excel internal cell data. @@ -15,7 +17,9 @@ import lombok.Data; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CellData extends AbstractCell { /** * cell type diff --git a/src/main/java/com/alibaba/excel/metadata/data/ClientAnchorData.java b/src/main/java/com/alibaba/excel/metadata/data/ClientAnchorData.java index 2416635d..1963133d 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/ClientAnchorData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/ClientAnchorData.java @@ -1,7 +1,8 @@ package com.alibaba.excel.metadata.data; -import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.Setter; import org.apache.poi.ss.usermodel.ClientAnchor; import org.apache.poi.util.Internal; @@ -21,7 +22,9 @@ import org.apache.poi.util.Internal; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ClientAnchorData extends CoordinateData { /** * top diff --git a/src/main/java/com/alibaba/excel/metadata/data/CommentData.java b/src/main/java/com/alibaba/excel/metadata/data/CommentData.java index 08cff272..6373b0a6 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/CommentData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/CommentData.java @@ -1,13 +1,17 @@ package com.alibaba.excel.metadata.data; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * comment * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CommentData extends ClientAnchorData { /** * Name of the original comment author diff --git a/src/main/java/com/alibaba/excel/metadata/data/CoordinateData.java b/src/main/java/com/alibaba/excel/metadata/data/CoordinateData.java index 69242e57..0755662b 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/CoordinateData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/CoordinateData.java @@ -1,13 +1,17 @@ package com.alibaba.excel.metadata.data; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * coordinate. * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CoordinateData { /** * first row index.Priority is higher than {@link #relativeFirstRowIndex}. diff --git a/src/main/java/com/alibaba/excel/metadata/data/DataFormatData.java b/src/main/java/com/alibaba/excel/metadata/data/DataFormatData.java index 877ca270..4f447632 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/DataFormatData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/DataFormatData.java @@ -2,14 +2,18 @@ package com.alibaba.excel.metadata.data; import com.alibaba.excel.util.StringUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * data format * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DataFormatData { /** * index diff --git a/src/main/java/com/alibaba/excel/metadata/data/FormulaData.java b/src/main/java/com/alibaba/excel/metadata/data/FormulaData.java index 36d0206b..f71ff2eb 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/FormulaData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/FormulaData.java @@ -1,13 +1,17 @@ package com.alibaba.excel.metadata.data; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * formula * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class FormulaData { /** * formula diff --git a/src/main/java/com/alibaba/excel/metadata/data/HyperlinkData.java b/src/main/java/com/alibaba/excel/metadata/data/HyperlinkData.java index 3fa23893..03edad13 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/HyperlinkData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/HyperlinkData.java @@ -1,14 +1,17 @@ package com.alibaba.excel.metadata.data; -import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.Setter; /** * hyperlink * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class HyperlinkData extends CoordinateData { /** * Depending on the hyperlink type it can be URL, e-mail, path to a file, etc diff --git a/src/main/java/com/alibaba/excel/metadata/data/ImageData.java b/src/main/java/com/alibaba/excel/metadata/data/ImageData.java index 20cd43e1..2ca1cdc8 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/ImageData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/ImageData.java @@ -1,14 +1,17 @@ package com.alibaba.excel.metadata.data; -import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.Setter; /** * image * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ImageData extends ClientAnchorData { /** diff --git a/src/main/java/com/alibaba/excel/metadata/data/ReadCellData.java b/src/main/java/com/alibaba/excel/metadata/data/ReadCellData.java index 68231a19..e1bb57ca 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/ReadCellData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/ReadCellData.java @@ -4,15 +4,19 @@ import java.math.BigDecimal; import com.alibaba.excel.enums.CellDataTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * read cell data * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public class ReadCellData extends CellData { /** diff --git a/src/main/java/com/alibaba/excel/metadata/data/RichTextStringData.java b/src/main/java/com/alibaba/excel/metadata/data/RichTextStringData.java index 1717741a..d277614f 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/RichTextStringData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/RichTextStringData.java @@ -6,15 +6,19 @@ import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.write.metadata.style.WriteFont; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * rich text string * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public class RichTextStringData { private String textString; @@ -25,7 +29,9 @@ public class RichTextStringData { this.textString = textString; } - @Data + @Getter + @Setter + @EqualsAndHashCode @AllArgsConstructor public static class IntervalFont { private Integer startIndex; diff --git a/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java b/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java index a988703a..f8ce9064 100644 --- a/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java +++ b/src/main/java/com/alibaba/excel/metadata/data/WriteCellData.java @@ -10,8 +10,10 @@ import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.write.metadata.style.WriteCellStyle; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; import org.apache.poi.ss.usermodel.CellStyle; /** @@ -19,7 +21,9 @@ import org.apache.poi.ss.usermodel.CellStyle; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public class WriteCellData extends CellData { /** diff --git a/src/main/java/com/alibaba/excel/metadata/property/DateTimeFormatProperty.java b/src/main/java/com/alibaba/excel/metadata/property/DateTimeFormatProperty.java index d2bb20cd..10752b74 100644 --- a/src/main/java/com/alibaba/excel/metadata/property/DateTimeFormatProperty.java +++ b/src/main/java/com/alibaba/excel/metadata/property/DateTimeFormatProperty.java @@ -3,14 +3,18 @@ package com.alibaba.excel.metadata.property; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.alibaba.excel.util.BooleanUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Configuration from annotations * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DateTimeFormatProperty { private String format; private Boolean use1904windowing; diff --git a/src/main/java/com/alibaba/excel/metadata/property/ExcelContentProperty.java b/src/main/java/com/alibaba/excel/metadata/property/ExcelContentProperty.java index 1c0bb232..f0b72198 100644 --- a/src/main/java/com/alibaba/excel/metadata/property/ExcelContentProperty.java +++ b/src/main/java/com/alibaba/excel/metadata/property/ExcelContentProperty.java @@ -4,12 +4,16 @@ import java.lang.reflect.Field; import com.alibaba.excel.converters.Converter; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author jipengfei */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExcelContentProperty { public static final ExcelContentProperty EMPTY = new ExcelContentProperty(); diff --git a/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java b/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java index a0359fb3..f3a8474a 100644 --- a/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java +++ b/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java @@ -17,7 +17,9 @@ import com.alibaba.excel.util.MapUtils; import com.alibaba.excel.util.StringUtils; import com.alibaba.excel.write.metadata.holder.AbstractWriteHolder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,7 +29,9 @@ import org.slf4j.LoggerFactory; * * @author jipengfei */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExcelHeadProperty { private static final Logger LOGGER = LoggerFactory.getLogger(ExcelHeadProperty.class); diff --git a/src/main/java/com/alibaba/excel/metadata/property/FontProperty.java b/src/main/java/com/alibaba/excel/metadata/property/FontProperty.java index 619cfe6b..c280b921 100644 --- a/src/main/java/com/alibaba/excel/metadata/property/FontProperty.java +++ b/src/main/java/com/alibaba/excel/metadata/property/FontProperty.java @@ -4,7 +4,9 @@ import com.alibaba.excel.annotation.write.style.ContentFontStyle; import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.util.StringUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.common.usermodel.fonts.FontCharset; import org.apache.poi.hssf.usermodel.HSSFPalette; import org.apache.poi.ss.usermodel.Font; @@ -15,7 +17,9 @@ import org.apache.poi.ss.usermodel.IndexedColors; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class FontProperty { /** * The name for the font (i.e. Arial) diff --git a/src/main/java/com/alibaba/excel/metadata/property/StyleProperty.java b/src/main/java/com/alibaba/excel/metadata/property/StyleProperty.java index 4ef87f68..bb469cd3 100644 --- a/src/main/java/com/alibaba/excel/metadata/property/StyleProperty.java +++ b/src/main/java/com/alibaba/excel/metadata/property/StyleProperty.java @@ -5,7 +5,9 @@ import com.alibaba.excel.annotation.write.style.HeadStyle; import com.alibaba.excel.metadata.data.DataFormatData; import com.alibaba.excel.write.metadata.style.WriteFont; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.BuiltinFormats; import org.apache.poi.ss.usermodel.FillPatternType; @@ -19,7 +21,9 @@ import org.apache.poi.ss.usermodel.VerticalAlignment; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class StyleProperty { /** * Set the data format (must be a valid format). Built in formats are defined at {@link BuiltinFormats}. diff --git a/src/main/java/com/alibaba/excel/read/metadata/ReadBasicParameter.java b/src/main/java/com/alibaba/excel/read/metadata/ReadBasicParameter.java index b5d17cbe..59149fb3 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/ReadBasicParameter.java +++ b/src/main/java/com/alibaba/excel/read/metadata/ReadBasicParameter.java @@ -6,14 +6,18 @@ import java.util.List; import com.alibaba.excel.metadata.BasicParameter; import com.alibaba.excel.read.listener.ReadListener; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Read basic parameter * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ReadBasicParameter extends BasicParameter { /** * Count the number of added heads when read sheet. diff --git a/src/main/java/com/alibaba/excel/read/metadata/ReadWorkbook.java b/src/main/java/com/alibaba/excel/read/metadata/ReadWorkbook.java index f8106631..54ab034c 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/ReadWorkbook.java +++ b/src/main/java/com/alibaba/excel/read/metadata/ReadWorkbook.java @@ -14,14 +14,18 @@ import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.read.listener.ModelBuildEventListener; import com.alibaba.excel.support.ExcelTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Workbook * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ReadWorkbook extends ReadBasicParameter { /** * Excel type diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/AbstractReadHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/AbstractReadHolder.java index 6561d377..8163a5df 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/AbstractReadHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/AbstractReadHolder.java @@ -15,15 +15,19 @@ import com.alibaba.excel.read.metadata.ReadWorkbook; import com.alibaba.excel.read.metadata.property.ExcelReadHeadProperty; import com.alibaba.excel.util.ListUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * Read Holder * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public abstract class AbstractReadHolder extends AbstractHolder implements ReadHolder { /** diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadSheetHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadSheetHolder.java index 558bec57..197835ad 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadSheetHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadSheetHolder.java @@ -9,15 +9,19 @@ import com.alibaba.excel.metadata.CellExtra; import com.alibaba.excel.metadata.data.ReadCellData; import com.alibaba.excel.read.metadata.ReadSheet; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * sheet holder * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public class ReadSheetHolder extends AbstractReadHolder { diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java index b1e03e4f..7de30aa5 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java @@ -19,15 +19,19 @@ import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.ReadWorkbook; import com.alibaba.excel.support.ExcelTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * Workbook holder * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public class ReadWorkbookHolder extends AbstractReadHolder { diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadSheetHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadSheetHolder.java index d6bf6953..1b784e44 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadSheetHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadSheetHolder.java @@ -4,14 +4,18 @@ import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.holder.ReadSheetHolder; import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * sheet holder * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvReadSheetHolder extends ReadSheetHolder { public CsvReadSheetHolder(ReadSheet readSheet, ReadWorkbookHolder readWorkbookHolder) { diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadWorkbookHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadWorkbookHolder.java index 8066fab6..0a322d58 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/csv/CsvReadWorkbookHolder.java @@ -4,7 +4,9 @@ import com.alibaba.excel.read.metadata.ReadWorkbook; import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; import com.alibaba.excel.support.ExcelTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.csv.CSVFormat; /** @@ -12,7 +14,9 @@ import org.apache.commons.csv.CSVFormat; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvReadWorkbookHolder extends ReadWorkbookHolder { private CSVFormat csvFormat; diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java index b29ba455..f4ed56e7 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadSheetHolder.java @@ -7,14 +7,18 @@ import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.holder.ReadSheetHolder; import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * sheet holder * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class XlsxReadSheetHolder extends ReadSheetHolder { /** * Record the label of the current operation to prevent NPE. diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java index 24ff8503..4e70aa0e 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java @@ -11,7 +11,9 @@ import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.util.MapUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.xssf.model.StylesTable; import org.apache.poi.xssf.usermodel.XSSFCellStyle; @@ -21,7 +23,9 @@ import org.apache.poi.xssf.usermodel.XSSFCellStyle; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class XlsxReadWorkbookHolder extends ReadWorkbookHolder { /** * Package diff --git a/src/main/java/com/alibaba/excel/util/ClassUtils.java b/src/main/java/com/alibaba/excel/util/ClassUtils.java index 8c7dd6b4..82f78af2 100644 --- a/src/main/java/com/alibaba/excel/util/ClassUtils.java +++ b/src/main/java/com/alibaba/excel/util/ClassUtils.java @@ -32,7 +32,9 @@ import com.alibaba.excel.metadata.property.StyleProperty; import com.alibaba.excel.write.metadata.holder.WriteHolder; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import net.sf.cglib.beans.BeanMap; /** @@ -403,7 +405,9 @@ public class ClassUtils { } } - @Data + @Getter + @Setter + @EqualsAndHashCode @AllArgsConstructor public static class ContentPropertyKey { private Class clazz; diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java index 331c4989..af90d8d5 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java @@ -33,7 +33,9 @@ import com.alibaba.excel.write.metadata.fill.FillWrapper; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.hssf.usermodel.PoiUtils; import org.apache.poi.ss.usermodel.Cell; @@ -232,6 +234,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { List> cellDataList = new ArrayList<>(); cellWriteHandlerContext.setExcelContentProperty(ExcelContentProperty.EMPTY); + cellWriteHandlerContext.setIgnoreFillStyle(Boolean.TRUE); createCell(analysisCell, fillConfig, cellWriteHandlerContext); Cell cell = cellWriteHandlerContext.getCell(); @@ -600,7 +603,9 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { return new UniqueDataFlagKey(writeSheetHolder.getSheetNo(), writeSheetHolder.getSheetName(), wrapperName); } - @Data + @Getter + @Setter + @EqualsAndHashCode @AllArgsConstructor public static class UniqueDataFlagKey { private Integer sheetNo; diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java index 4826d6bc..35afe6fc 100644 --- a/src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java +++ b/src/main/java/com/alibaba/excel/write/handler/chain/CellHandlerExecutionChain.java @@ -3,14 +3,18 @@ package com.alibaba.excel.write.handler.chain; import com.alibaba.excel.write.handler.CellWriteHandler; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Execute the cell handler chain * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CellHandlerExecutionChain { /** * next chain diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java index 872afa8a..4f32f3b1 100644 --- a/src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java +++ b/src/main/java/com/alibaba/excel/write/handler/chain/RowHandlerExecutionChain.java @@ -3,14 +3,18 @@ package com.alibaba.excel.write.handler.chain; import com.alibaba.excel.write.handler.RowWriteHandler; import com.alibaba.excel.write.handler.context.RowWriteHandlerContext; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Execute the row handler chain * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class RowHandlerExecutionChain { /** * next chain diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java index 56770496..7e079dd2 100644 --- a/src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java +++ b/src/main/java/com/alibaba/excel/write/handler/chain/SheetHandlerExecutionChain.java @@ -3,14 +3,18 @@ package com.alibaba.excel.write.handler.chain; import com.alibaba.excel.write.handler.SheetWriteHandler; import com.alibaba.excel.write.handler.context.SheetWriteHandlerContext; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Execute the sheet handler chain * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class SheetHandlerExecutionChain { /** * next chain diff --git a/src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java b/src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java index c7dacbb4..56e746e0 100644 --- a/src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java +++ b/src/main/java/com/alibaba/excel/write/handler/chain/WorkbookHandlerExecutionChain.java @@ -3,14 +3,18 @@ package com.alibaba.excel.write.handler.chain; import com.alibaba.excel.write.handler.WorkbookWriteHandler; import com.alibaba.excel.write.handler.context.WorkbookWriteHandlerContext; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Execute the workbook handler chain * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WorkbookHandlerExecutionChain { /** * next chain diff --git a/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java index bd6b1930..0007e7ac 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/CellWriteHandlerContext.java @@ -12,7 +12,9 @@ import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteTableHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; @@ -21,7 +23,9 @@ import org.apache.poi.ss.usermodel.Row; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CellWriteHandlerContext { /** * write context diff --git a/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java index 6578d3a2..c01c8b5b 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/RowWriteHandlerContext.java @@ -6,7 +6,9 @@ import com.alibaba.excel.write.metadata.holder.WriteTableHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.ss.usermodel.Row; /** @@ -14,7 +16,9 @@ import org.apache.poi.ss.usermodel.Row; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @AllArgsConstructor public class RowWriteHandlerContext { /** diff --git a/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java index c1164eb0..f3c024f4 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/SheetWriteHandlerContext.java @@ -5,14 +5,18 @@ import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * sheet context * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @AllArgsConstructor public class SheetWriteHandlerContext { /** diff --git a/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java b/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java index f955d4bf..a7ec289c 100644 --- a/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java +++ b/src/main/java/com/alibaba/excel/write/handler/context/WorkbookWriteHandlerContext.java @@ -4,14 +4,18 @@ import com.alibaba.excel.context.WriteContext; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * workbook context * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @AllArgsConstructor public class WorkbookWriteHandlerContext { /** diff --git a/src/main/java/com/alibaba/excel/write/metadata/WriteBasicParameter.java b/src/main/java/com/alibaba/excel/write/metadata/WriteBasicParameter.java index 91527cc1..b0745d38 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/WriteBasicParameter.java +++ b/src/main/java/com/alibaba/excel/write/metadata/WriteBasicParameter.java @@ -7,14 +7,18 @@ import java.util.List; import com.alibaba.excel.metadata.BasicParameter; import com.alibaba.excel.write.handler.WriteHandler; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Write basic parameter * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteBasicParameter extends BasicParameter { /** * Writes the head relative to the existing contents of the sheet. Indexes are zero-based. diff --git a/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java b/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java index 04bfb822..1f41376c 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java +++ b/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java @@ -1,13 +1,17 @@ package com.alibaba.excel.write.metadata; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Write sheet * * @author jipengfei */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteSheet extends WriteBasicParameter { /** * Starting from 0 diff --git a/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java b/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java index a935f326..6681e1b8 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java +++ b/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java @@ -1,13 +1,17 @@ package com.alibaba.excel.write.metadata; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * table * * @author jipengfei */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteTable extends WriteBasicParameter { /** * Starting from 0 diff --git a/src/main/java/com/alibaba/excel/write/metadata/WriteWorkbook.java b/src/main/java/com/alibaba/excel/write/metadata/WriteWorkbook.java index bcc39211..38b368ec 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/WriteWorkbook.java +++ b/src/main/java/com/alibaba/excel/write/metadata/WriteWorkbook.java @@ -7,14 +7,18 @@ import java.nio.charset.Charset; import com.alibaba.excel.support.ExcelTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Workbook * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteWorkbook extends WriteBasicParameter { /** * Excel type.The default is xlsx diff --git a/src/main/java/com/alibaba/excel/write/metadata/fill/AnalysisCell.java b/src/main/java/com/alibaba/excel/write/metadata/fill/AnalysisCell.java index b9b377ed..783c7d89 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/fill/AnalysisCell.java +++ b/src/main/java/com/alibaba/excel/write/metadata/fill/AnalysisCell.java @@ -4,14 +4,18 @@ import java.util.List; import com.alibaba.excel.enums.WriteTemplateAnalysisCellTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Read the cells of the template while populating the data. * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class AnalysisCell { private int columnIndex; private int rowIndex; diff --git a/src/main/java/com/alibaba/excel/write/metadata/fill/FillConfig.java b/src/main/java/com/alibaba/excel/write/metadata/fill/FillConfig.java index 8fdb240a..ac5581ee 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/fill/FillConfig.java +++ b/src/main/java/com/alibaba/excel/write/metadata/fill/FillConfig.java @@ -4,15 +4,19 @@ import com.alibaba.excel.enums.WriteDirectionEnum; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; /** * Fill config * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode @Builder @NoArgsConstructor @AllArgsConstructor diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java index ca14886c..0b546703 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java @@ -41,8 +41,10 @@ import com.alibaba.excel.write.style.AbstractVerticalCellStyleStrategy; import com.alibaba.excel.write.style.column.AbstractHeadColumnWidthStyleStrategy; import com.alibaba.excel.write.style.row.SimpleRowHeightStyleStrategy; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; /** @@ -50,7 +52,9 @@ import org.apache.commons.collections4.CollectionUtils; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public abstract class AbstractWriteHolder extends AbstractHolder implements WriteHolder { /** @@ -380,9 +384,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } else { cellHandlerExecutionChain.addLast((CellWriteHandler)writeHandler); } - this.writeHandlerList.add(writeHandler); } - return; } if (writeHandler instanceof RowWriteHandler) { if (!runOwn) { @@ -391,9 +393,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } else { rowHandlerExecutionChain.addLast((RowWriteHandler)writeHandler); } - this.writeHandlerList.add(writeHandler); } - return; } if (writeHandler instanceof SheetWriteHandler) { if (!runOwn) { @@ -402,7 +402,6 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } else { sheetHandlerExecutionChain.addLast((SheetWriteHandler)writeHandler); } - this.writeHandlerList.add(writeHandler); } else { if (ownSheetHandlerExecutionChain == null) { ownSheetHandlerExecutionChain = new SheetHandlerExecutionChain((SheetWriteHandler)writeHandler); @@ -410,7 +409,6 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ ownSheetHandlerExecutionChain.addLast((SheetWriteHandler)writeHandler); } } - return; } if (writeHandler instanceof WorkbookWriteHandler) { if (!runOwn) { @@ -420,7 +418,6 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } else { workbookHandlerExecutionChain.addLast((WorkbookWriteHandler)writeHandler); } - this.writeHandlerList.add(writeHandler); } else { if (ownWorkbookHandlerExecutionChain == null) { ownWorkbookHandlerExecutionChain = new WorkbookHandlerExecutionChain( @@ -430,6 +427,9 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } } } + if (!runOwn) { + this.writeHandlerList.add(writeHandler); + } } @Override diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java index ede60eab..ffc6f759 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteSheetHolder.java @@ -8,8 +8,10 @@ import com.alibaba.excel.enums.WriteLastRowTypeEnum; import com.alibaba.excel.util.StringUtils; import com.alibaba.excel.write.metadata.WriteSheet; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.streaming.SXSSFSheet; @@ -20,7 +22,9 @@ import org.apache.poi.xssf.usermodel.XSSFSheet; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @NoArgsConstructor public class WriteSheetHolder extends AbstractWriteHolder { /** diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteTableHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteTableHolder.java index e353a44c..3a46e784 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteTableHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteTableHolder.java @@ -3,14 +3,18 @@ package com.alibaba.excel.write.metadata.holder; import com.alibaba.excel.enums.HolderEnum; import com.alibaba.excel.write.metadata.WriteTable; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * sheet holder * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteTableHolder extends AbstractWriteHolder { /*** * poi sheet diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java index 100e59a1..1353ddc4 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java @@ -24,7 +24,10 @@ import com.alibaba.excel.write.metadata.WriteWorkbook; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString.Exclude; import lombok.extern.slf4j.Slf4j; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFWorkbook; @@ -40,7 +43,9 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @Slf4j public class WriteWorkbookHolder extends AbstractWriteHolder { /*** @@ -147,6 +152,7 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { /** * handler context */ + @Exclude private WorkbookWriteHandlerContext workbookWriteHandlerContext; public WriteWorkbookHolder(WriteWorkbook writeWorkbook) { diff --git a/src/main/java/com/alibaba/excel/write/metadata/style/WriteCellStyle.java b/src/main/java/com/alibaba/excel/write/metadata/style/WriteCellStyle.java index 9298f9da..bebd210e 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/style/WriteCellStyle.java +++ b/src/main/java/com/alibaba/excel/write/metadata/style/WriteCellStyle.java @@ -6,7 +6,9 @@ import com.alibaba.excel.metadata.property.FontProperty; import com.alibaba.excel.metadata.property.StyleProperty; import com.alibaba.excel.util.StringUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.HorizontalAlignment; @@ -19,7 +21,9 @@ import org.apache.poi.ss.usermodel.VerticalAlignment; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteCellStyle { /** * Set the data format (must be a valid format). Built in formats are defined at {@link BuiltinFormats}. diff --git a/src/main/java/com/alibaba/excel/write/metadata/style/WriteFont.java b/src/main/java/com/alibaba/excel/write/metadata/style/WriteFont.java index d1f42f01..a42899e1 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/style/WriteFont.java +++ b/src/main/java/com/alibaba/excel/write/metadata/style/WriteFont.java @@ -2,7 +2,9 @@ package com.alibaba.excel.write.metadata.style; import com.alibaba.excel.util.StringUtils; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.poi.common.usermodel.fonts.FontCharset; import org.apache.poi.hssf.usermodel.HSSFPalette; import org.apache.poi.ss.usermodel.Font; @@ -13,7 +15,9 @@ import org.apache.poi.ss.usermodel.IndexedColors; * * @author jipengfei */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteFont { /** * The name for the font (i.e. Arial) diff --git a/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java b/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java index 84ba05a5..4c11010a 100644 --- a/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java +++ b/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java @@ -26,14 +26,18 @@ import com.alibaba.excel.metadata.property.OnceAbsoluteMergeProperty; import com.alibaba.excel.metadata.property.RowHeightProperty; import com.alibaba.excel.metadata.property.StyleProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * Define the header attribute of excel * * @author jipengfei */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExcelWriteHeadProperty extends ExcelHeadProperty { private RowHeightProperty headRowHeightProperty; diff --git a/src/main/java/com/alibaba/excel/write/style/HorizontalCellStyleStrategy.java b/src/main/java/com/alibaba/excel/write/style/HorizontalCellStyleStrategy.java index 8f033710..df04d248 100644 --- a/src/main/java/com/alibaba/excel/write/style/HorizontalCellStyleStrategy.java +++ b/src/main/java/com/alibaba/excel/write/style/HorizontalCellStyleStrategy.java @@ -7,7 +7,9 @@ import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; import com.alibaba.excel.write.metadata.style.WriteCellStyle; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; /** @@ -15,7 +17,9 @@ import org.apache.commons.collections4.CollectionUtils; * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class HorizontalCellStyleStrategy extends AbstractCellStyleStrategy { private WriteCellStyle headWriteCellStyle; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java index 40bc4b0b..0ed28a29 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java @@ -10,12 +10,16 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.annotation.write.style.HeadRowHeight; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @ColumnWidth(50) @HeadRowHeight(50) @ContentRowHeight(100) diff --git a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java index b41f093d..fa93f2ed 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.annotation; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class AnnotationIndexAndNameData { @ExcelProperty(value = "第四个", index = 4) private String index4; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java b/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java index b8322073..ad50e4a0 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java @@ -3,12 +3,16 @@ package com.alibaba.easyexcel.test.core.celldata; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.alibaba.excel.metadata.data.ReadCellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CellDataReadData { @DateTimeFormat("yyyy年MM月dd日") private ReadCellData date; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java b/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java index 69ed7bbf..cf10b0d7 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java @@ -5,12 +5,16 @@ import java.util.Date; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.alibaba.excel.metadata.data.WriteCellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CellDataWriteData { @DateTimeFormat("yyyy年MM月dd日") private WriteCellData date; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java b/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java index 8fa78f7e..f9a6bee6 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java @@ -8,12 +8,16 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.metadata.data.ReadCellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ConverterReadData { @ExcelProperty("日期") private Date date; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java b/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java index 68c34423..6782aa1a 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java @@ -8,12 +8,16 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.metadata.data.WriteCellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ConverterWriteData { @ExcelProperty("日期") private Date date; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java b/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java index f8d6ac21..fb31e127 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java @@ -8,12 +8,16 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.converters.string.StringImageConverter; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @ContentRowHeight(500) @ColumnWidth(500 / 8) public class ImageData { diff --git a/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java b/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java index cccee710..dac73127 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java @@ -5,12 +5,16 @@ import java.math.BigInteger; import java.time.LocalDateTime; import java.util.Date; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ReadAllConverterData { private BigDecimal bigDecimalBoolean; private BigDecimal bigDecimalNumber; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java b/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java index 1930bce5..5958161c 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java @@ -1,11 +1,15 @@ package com.alibaba.easyexcel.test.core.dataformat; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DateFormatData { private String date; private String dateStringCn; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java b/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java index 19ef8d03..6cba3a71 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.encrypt; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class EncryptData { @ExcelProperty("姓名") private String name; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java b/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java index 28d273e4..c989ce99 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.exception; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExceptionData { @ExcelProperty("姓名") private String name; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java b/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java index 7c49b01d..737bd61b 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.excludeorinclude; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExcludeOrIncludeData { @ExcelProperty(order = 1) private String column1; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java b/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java index 61822fa8..0424509e 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java @@ -1,11 +1,15 @@ package com.alibaba.easyexcel.test.core.extra; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExtraData { private String row1; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java index a1dd56a3..9a33351c 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java @@ -4,12 +4,16 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.format.NumberFormat; import com.alibaba.excel.converters.doubleconverter.DoubleStringConverter; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class FillData { private String name; @NumberFormat("#") diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java index 52b1cc04..c568e027 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java @@ -7,12 +7,16 @@ import com.alibaba.excel.annotation.write.style.ContentStyle; import com.alibaba.excel.enums.BooleanEnum; import com.alibaba.excel.enums.poi.FillPatternTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class FillStyleAnnotatedData { @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 13) @ContentFontStyle(bold = BooleanEnum.TRUE, color = 19) diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java index 98c29fb2..20af16a3 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.fill.style; import java.util.Date; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class FillStyleData { private String name; private Double number; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java b/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java index ad2188aa..ec81e596 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.handler; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteHandlerData { @ExcelProperty("姓名") private String name; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java b/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java index 30e7e814..38eb2b8a 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.head; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ComplexHeadData { @ExcelProperty({"顶格", "顶格", "两格"}) private String string0; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java b/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java index 7e19af15..a45bcf9c 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.head; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class NoHeadData { @ExcelProperty("字符串") private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java index 246f9cbd..1bd5a748 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java @@ -1,11 +1,15 @@ package com.alibaba.easyexcel.test.core.large; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class LargeData { private String str1; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java b/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java index 73da1c31..22b00e19 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java @@ -1,11 +1,15 @@ package com.alibaba.easyexcel.test.core.multiplesheets; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class MultipleSheetsData { private String title; } diff --git a/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java b/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java index dd010fc7..286ef8fe 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java @@ -1,11 +1,15 @@ package com.alibaba.easyexcel.test.core.noncamel; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class UnCamelData { private String string1; private String String2; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java b/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java index 7e22a2e7..fedabaa0 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.parameter; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ParameterData { @ExcelProperty("姓名") private String name; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java index 0a7378f2..e77a995e 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.repetition; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class RepetitionData { @ExcelProperty("字符串") private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java b/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java index 6c541a24..0e43b3c8 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.simple; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class SimpleData { @ExcelProperty("姓名") private String name; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java b/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java index 1476448b..8e0d55ee 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.skip; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class SkipData { @ExcelProperty("姓名") diff --git a/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java b/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java index 870abe87..668dd899 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.sort; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class SortData { private String column5; private String column6; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java index cc30893e..b6b67c9d 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java @@ -4,12 +4,16 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.annotation.write.style.HeadStyle; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @HeadStyle @HeadFontStyle public class StyleData { diff --git a/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java index 31778a21..02d01215 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.core.template; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class TemplateData { @ExcelProperty("字符串0") private String string0; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java b/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java index 589f838c..6eb34ada 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.demo.fill; import java.util.Date; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class FillData { private String name; private double number; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java b/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java index 357dbfe9..b29c39bf 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java @@ -4,14 +4,18 @@ import java.util.Date; import com.alibaba.excel.metadata.data.CellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类.这里的排序和excel里面的排序一致 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CellDataReadDemoData { private CellData string; // 这里注意 虽然是日期 但是 类型 存储的是number 因为excel 存储的就是number diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java b/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java index bc27e1f8..2e87616f 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java @@ -4,14 +4,18 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.alibaba.excel.annotation.format.NumberFormat; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类.这里的排序和excel里面的排序一致 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ConverterData { /** * 我自定义 转换器,不管数据库传过来什么 。我给他加上“自定义:” diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java b/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java index a7a7519b..6c3321d2 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java @@ -2,14 +2,18 @@ package com.alibaba.easyexcel.test.demo.read; import java.util.Date; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类.这里的排序和excel里面的排序一致 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DemoData { private String string; private Date date; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java b/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java index e780bfa7..b0d9a03c 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java @@ -1,11 +1,15 @@ package com.alibaba.easyexcel.test.demo.read; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DemoExtraData { private String row1; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java b/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java index 8040728d..b202311d 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java @@ -2,14 +2,18 @@ package com.alibaba.easyexcel.test.demo.read; import java.util.Date; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类.这里的排序和excel里面的排序一致 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ExceptionDemoData { /** * 用日期去接字符串 肯定报错 diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java b/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java index 1521b8cd..a545ffa8 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java @@ -4,14 +4,18 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class IndexOrNameData { /** * 强制读取第三个 这里不建议 index 和 name 同时用,要么一个对象只用index,要么一个对象只用name去匹配 diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java b/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java index 4fa3a780..501ecc78 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java @@ -4,14 +4,18 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DownloadData { @ExcelProperty("字符串标题") private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java b/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java index 80a0e658..2993969a 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java @@ -2,14 +2,18 @@ package com.alibaba.easyexcel.test.demo.web; import java.util.Date; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class UploadData { private String string; private Date date; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java index 44ce5cc7..74a157d1 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java @@ -4,14 +4,18 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 复杂头数据.这里最终效果是第一行就一个主标题,第二行分类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ComplexHeadData { @ExcelProperty({"主标题", "字符串标题"}) private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java index 864cfcbf..c120e47a 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java @@ -6,14 +6,18 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.alibaba.excel.annotation.format.NumberFormat; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类.这里的排序和excel里面的排序一致 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class ConverterData { /** * 我想所有的 字符串起前面加上"自定义:"三个字 diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java index 8a7902b5..76b50584 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java @@ -3,17 +3,20 @@ package com.alibaba.easyexcel.test.demo.write; import java.util.Date; import com.alibaba.excel.annotation.ExcelIgnore; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DemoData { @ExcelProperty("字符串标题") private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java index ad94321e..44279db6 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java @@ -5,14 +5,18 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ContentLoopMerge; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 样式的数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode // 将第6-7行的2-3列合并成一个单元格 // @OnceAbsoluteMerge(firstRowIndex = 5, lastRowIndex = 6, firstColumnIndex = 1, lastColumnIndex = 2) public class DemoMergeData { diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java index 6dc60ed1..eded587b 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java @@ -9,14 +9,18 @@ import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.annotation.write.style.HeadStyle; import com.alibaba.excel.enums.poi.FillPatternTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 样式的数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode // 头背景设置成红色 IndexedColors.RED.getIndex() @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 10) // 头字体设置成20 diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java index a7bd7caa..4c39ffb1 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java @@ -9,13 +9,17 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.converters.string.StringImageConverter; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 图片导出类 * */ -@Data +@Getter +@Setter +@EqualsAndHashCode @ContentRowHeight(100) @ColumnWidth(100 / 8) public class ImageDataWithAnnotation { diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java index ba80d6f1..9f1ebca3 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java @@ -10,14 +10,18 @@ import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.converters.string.StringImageConverter; import com.alibaba.excel.metadata.data.WriteCellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 图片导出类 * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @ContentRowHeight(100) @ColumnWidth(100 / 8) public class ImageDemoData { diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java index 81c2d4e1..47c8c3b4 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java @@ -4,14 +4,18 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class IndexData { @ExcelProperty(value = "字符串标题", index = 0) private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java index 69ad51dc..645be062 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java @@ -4,14 +4,18 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class LongestMatchColumnWidthData { @ExcelProperty("字符串标题") private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java index 42a7f883..a3a9b7f2 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java @@ -7,14 +7,18 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.annotation.write.style.HeadRowHeight; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode @ContentRowHeight(10) @HeadRowHeight(20) @ColumnWidth(25) diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java index 2dfed31d..0cd50ddd 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java @@ -2,14 +2,18 @@ package com.alibaba.easyexcel.test.demo.write; import com.alibaba.excel.metadata.data.WriteCellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 根据WriteCellData写 * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteCellDemoData { /** * 超链接 diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java b/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java index 9c3f39e4..86b9f4f7 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java @@ -1,13 +1,17 @@ package com.alibaba.easyexcel.test.temp; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * TODO * * @author 是仪 */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CamlData { private String string1; private String String2; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java b/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java index 14fa65e3..88195cf9 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java @@ -2,14 +2,18 @@ package com.alibaba.easyexcel.test.temp; import com.alibaba.excel.annotation.format.NumberFormat; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 基础数据类.这里的排序和excel里面的排序一致 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class LockData { @NumberFormat("#.##%") private Double string0; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java b/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java index 89214922..89453e5e 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java @@ -2,13 +2,17 @@ package com.alibaba.easyexcel.test.temp; import java.util.List; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class StyleData { private byte[] byteValue; private Byte[] byteValue2; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java b/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java index 55984a73..dbbb7058 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java @@ -2,12 +2,16 @@ package com.alibaba.easyexcel.test.temp; import com.alibaba.excel.annotation.write.style.ContentRowHeight; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @ContentRowHeight(30) public class TempFillData { private String name; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java b/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java index 37b8dc2b..b781f9fa 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java @@ -1,14 +1,19 @@ package com.alibaba.easyexcel.test.temp.bug; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author jiaosong * @desc * @date 2021/4/6 */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DataType { /** * 任务id diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java b/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java index 15ee006d..bcfa101c 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java @@ -1,14 +1,19 @@ package com.alibaba.easyexcel.test.temp.bug; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author jiaosong * @desc * @date 2021/4/6 */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class HeadType { diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java b/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java index 2f645339..1cc91c72 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java @@ -5,14 +5,18 @@ import java.util.Date; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * TODO * * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class CsvData { @ExcelProperty("字符串标题") private String string; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java b/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java index 8a4b1fb7..ef92e62c 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java @@ -2,9 +2,13 @@ package com.alibaba.easyexcel.test.temp.data; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; -@Data +@Getter +@Setter +@EqualsAndHashCode public class DataType { /** * 任务id diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java b/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java index 32bd065e..2eaf0a27 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java @@ -2,9 +2,13 @@ package com.alibaba.easyexcel.test.temp.data; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; -@Data +@Getter +@Setter +@EqualsAndHashCode public class HeadType { diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java b/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java index 86303729..bd7a7acb 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java @@ -1,16 +1,19 @@ package com.alibaba.easyexcel.test.temp.dataformat; import com.alibaba.excel.metadata.data.ReadCellData; -import com.alibaba.excel.metadata.data.WriteCellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * TODO * * @author 罗成 **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class DataFormatData { private ReadCellData date; private ReadCellData num; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java b/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java index 17c34cf1..0ddda379 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java @@ -1,11 +1,15 @@ package com.alibaba.easyexcel.test.temp.fill; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode public class FillData2 { private String test; } diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java b/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java index 53a1a5c8..818aa524 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java @@ -1,13 +1,18 @@ package com.alibaba.easyexcel.test.temp.issue1662; +import java.util.Date; + import com.alibaba.excel.annotation.ExcelProperty; + import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; -import java.util.Date; - -@Data +@Getter +@Setter +@EqualsAndHashCode @AllArgsConstructor @NoArgsConstructor public class Data1662 { diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java b/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java index 57b54107..0dfd27f7 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java @@ -1,8 +1,12 @@ package com.alibaba.easyexcel.test.temp.issue1663; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; -@Data +@Getter +@Setter +@EqualsAndHashCode public class FillData { private String name; private double number; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java b/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java index 43726ad3..59444b38 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java @@ -1,12 +1,16 @@ package com.alibaba.easyexcel.test.temp.large; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * @author Jiaju Zhuang */ -@Data +@Getter +@Setter +@EqualsAndHashCode @Builder public class LargeData { diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java b/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java index 0edc995d..99540f2a 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java @@ -4,14 +4,18 @@ import java.util.List; import com.alibaba.excel.metadata.data.CellData; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * TODO * * @author 罗成 **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class TestCell { private CellData c1; private CellData> c2; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java b/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java index 62d5e317..90a721a2 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java @@ -2,15 +2,18 @@ package com.alibaba.easyexcel.test.temp.read; import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; -import lombok.experimental.Accessors; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * 临时测试 * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class HeadReadData { @ExcelProperty({"主标题","数据1"}) private String h1; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java b/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java index 8de542d1..97c26ed9 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java @@ -7,9 +7,13 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.HeadStyle; import com.alibaba.excel.enums.poi.FillPatternTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; -@Data +@Getter +@Setter +@EqualsAndHashCode public class DemoData1 { @ExcelProperty("字符串标题") @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 42) diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java b/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java index 00d99041..ddc0e3db 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java @@ -7,9 +7,13 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.HeadStyle; import com.alibaba.excel.enums.poi.FillPatternTypeEnum; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; -@Data +@Getter +@Setter +@EqualsAndHashCode public class DemoData2 { @ExcelProperty("字符串标题") @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 42) diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java b/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java index a9ba7fa4..34a60bc8 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java @@ -1,13 +1,17 @@ package com.alibaba.easyexcel.test.temp.simple; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * TODO * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class JsonData { private String SS1; private String sS2; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java b/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java index 27967b9f..d9a035ce 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java @@ -2,16 +2,18 @@ package com.alibaba.easyexcel.test.temp.simple; import java.util.Date; -import com.alibaba.excel.annotation.write.style.ContentStyle; - -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; /** * write data * * @author Jiaju Zhuang **/ -@Data +@Getter +@Setter +@EqualsAndHashCode public class WriteData { // @ContentStyle(locked = true) private Date dd;