add MethodUtil

This commit is contained in:
Looly
2022-05-05 00:24:08 +08:00
parent 140e1d546f
commit 6d7d350886
30 changed files with 1168 additions and 1234 deletions

View File

@@ -2,9 +2,9 @@ package cn.hutool.poi.excel.sax;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.reflect.ReflectUtil;
import cn.hutool.core.reflect.MethodUtil;
import cn.hutool.core.text.StrUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.poi.excel.sax.handler.RowHandler;
import cn.hutool.poi.exceptions.POIException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@@ -20,7 +20,7 @@ import java.util.Iterator;
/**
* Sax方式读取Excel文件<br>
* Excel2007格式说明见http://www.cnblogs.com/wangmingshun/p/6654143.html
* Excel2007格式说明见<a href="http://www.cnblogs.com/wangmingshun/p/6654143.html">http://www.cnblogs.com/wangmingshun/p/6654143.html</a>
*
* @author Looly
* @since 3.1.2
@@ -130,7 +130,7 @@ public class Excel07SaxReader implements ExcelSaxReader<Excel07SaxReader> {
// 获取共享字符串表
// POI-5.2.0开始返回值有所变更,导致实际使用时提示方法未找到,此处使用反射调用,解决不同版本返回值变更问题
//this.handler.sharedStrings = xssfReader.getSharedStringsTable();
this.handler.sharedStrings = ReflectUtil.invoke(xssfReader, "getSharedStringsTable");
this.handler.sharedStrings = MethodUtil.invoke(xssfReader, "getSharedStringsTable");
return readSheets(xssfReader, idOrRidOrSheetName);
}