add default method

This commit is contained in:
Looly
2020-05-28 01:16:42 +08:00
parent 44fe8904a2
commit 6b6366e1ef
12 changed files with 298 additions and 113 deletions

View File

@@ -7,15 +7,17 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.sax.Excel03SaxReader;
import cn.hutool.poi.excel.sax.handler.RowHandler;
import org.apache.poi.ss.usermodel.CellStyle;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import java.util.List;
/**
* Excel sax方式读取
*
* @author looly
*
* @author looly
*/
public class ExcelSaxReadTest {
@@ -64,4 +66,39 @@ public class ExcelSaxReadTest {
}
};
}
@Test
@Ignore
public void handle07CellTest() {
ExcelUtil.readBySax("d:/test/test.xlsx", -1, new RowHandler() {
@Override
public void handleCell(int sheetIndex, long rowIndex, int cellIndex, Object value, CellStyle xssfCellStyle) {
Console.log("{} {} {}", rowIndex, cellIndex, value);
}
@Override
public void handle(int sheetIndex, long rowIndex, List<Object> rowList) {
}
}
);
}
@Test
@Ignore
public void handle03CellTest() {
ExcelUtil.readBySax("d:/test/test.xls", -1, new RowHandler() {
@Override
public void handleCell(int sheetIndex, long rowIndex, int cellIndex, Object value, CellStyle xssfCellStyle) {
Console.log("{} {} {}", rowIndex, cellIndex, value);
}
@Override
public void handle(int sheetIndex, long rowIndex, List<Object> rowList) {
}
}
);
}
}