Browse Source

新增since

pull/815/head
Jiaju Zhuang 5 years ago
parent
commit
7b9890ae51
  1. 7
      src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java
  2. 2
      src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java
  3. 12
      src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
  4. 4
      update.md

7
src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java

@ -25,10 +25,13 @@ public class ExcelBuilderImpl implements ExcelBuilder {
private ExcelWriteFillExecutor excelWriteFillExecutor; private ExcelWriteFillExecutor excelWriteFillExecutor;
private ExcelWriteAddExecutor excelWriteAddExecutor; private ExcelWriteAddExecutor excelWriteAddExecutor;
public ExcelBuilderImpl(WriteWorkbook writeWorkbook) { static {
try {
// Create temporary cache directory at initialization time to avoid POI concurrent write bugs // Create temporary cache directory at initialization time to avoid POI concurrent write bugs
FileUtils.createPoiFilesDirectory(); FileUtils.createPoiFilesDirectory();
}
public ExcelBuilderImpl(WriteWorkbook writeWorkbook) {
try {
context = new WriteContextImpl(writeWorkbook); context = new WriteContextImpl(writeWorkbook);
} catch (RuntimeException e) { } catch (RuntimeException e) {
finishOnException(); finishOnException();

2
src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java

@ -73,6 +73,8 @@ public class WriteTest {
* 2. 根据自己或者排除自己需要的列 * 2. 根据自己或者排除自己需要的列
* <p> * <p>
* 3. 直接写即可 * 3. 直接写即可
*
* @since 2.1.1
*/ */
@Test @Test
public void excludeOrIncludeWrite() { public void excludeOrIncludeWrite() {

12
src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java

@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.cache.Ehcache;
/** /**
* 临时测试 * 临时测试
@ -25,4 +26,15 @@ public class HeadReadTest {
} }
@Test
public void testCache() throws Exception {
File file = new File("D:\\test\\headt1.xls");
EasyExcel.read(file, HeadReadData.class, new HDListener()).readCache(new Ehcache(20)).sheet(0).doRead();
LOGGER.info("------------------");
EasyExcel.read(file, HeadReadData.class, new HDListener()).readCache(new Ehcache(20)).sheet(0).doRead();
LOGGER.info("------------------");
EasyExcel.read(file, HeadReadData.class, new HDListener()).readCache(new Ehcache(20)).sheet(0).doRead();
}
} }

4
update.md

@ -1,3 +1,5 @@
# 2.1.2
# 2.1.1 # 2.1.1
* 发布正式版 * 发布正式版
* 修改map返回为LinkedHashMap * 修改map返回为LinkedHashMap
@ -61,7 +63,7 @@
* 修复监听器转换异常会重复提示的bug * 修复监听器转换异常会重复提示的bug
# 2.0.1 # 2.0.1
* 降级poi为3.1.7 兼容jdk6 * 降级poi为3.17 兼容jdk6
# 2.0.0 # 2.0.0
* 修复当cell为空可能会抛出空指针的bug * 修复当cell为空可能会抛出空指针的bug

Loading…
Cancel
Save