public class ExcelReader extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static String |
DATE_FORMAT |
private static String |
ERROR |
private static DecimalFormat |
fmtDecimal |
private static org.slf4j.Logger |
logger |
| 构造器和说明 |
|---|
ExcelReader() |
| 限定符和类型 | 方法和说明 |
|---|---|
private static String[] |
buildRowValues(org.apache.poi.ss.usermodel.Row hssfRow,
int rowNum,
int cellCount)
组装行数据
|
private static String |
getValue(org.apache.poi.ss.usermodel.Cell cell)
获取Excel单元格的值
|
private static List<String[]> |
readXls(InputStream is)
Read the Excel 2003-2007
|
private static List<String[]> |
readXlsx(InputStream is)
Read the Excel 2010
|
static List<String[]> |
toList(File file)
对excel文件的解析
|
static List<String[]> |
toList(org.springframework.web.multipart.MultipartFile file)
对excel文件的解析
|
static List<String[]> |
toList(String excelFilePath)
对excel文件的解析
|
private static final org.slf4j.Logger logger
private static DecimalFormat fmtDecimal
public static List<String[]> toList(String excelFilePath) throws Exception
excelFilePath - Exceptionpublic static List<String[]> toList(File file) throws Exception
file - Exceptionpublic static List<String[]> toList(org.springframework.web.multipart.MultipartFile file) throws Exception
file - Exceptionprivate static List<String[]> readXlsx(InputStream is) throws Exception
is - the path of the excel fileExceptionprivate static List<String[]> readXls(InputStream is) throws Exception
is - the path of the ExcelExceptionprivate static String[] buildRowValues(org.apache.poi.ss.usermodel.Row hssfRow, int rowNum, int cellCount) throws Exception
hssfRow - rowNum - cellCount - Exceptionprivate static String getValue(org.apache.poi.ss.usermodel.Cell cell)
cell - Copyright © 2018. All rights reserved.