public class ExcelImport
extends java.lang.Object
| 构造器和说明 |
|---|
ExcelImport(java.io.File file,
int headerNum)
构造函数
|
ExcelImport(java.io.File file,
int headerNum,
int sheetIndex)
构造函数
|
ExcelImport(org.springframework.web.multipart.MultipartFile multipartFile,
int headerNum,
int sheetIndex)
构造函数
|
ExcelImport(java.lang.String fileName,
java.io.InputStream is,
int headerNum,
int sheetIndex)
构造函数
|
ExcelImport(java.lang.String fileName,
int headerNum)
构造函数
|
ExcelImport(java.lang.String fileName,
int headerNum,
int sheetIndex)
构造函数
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.Object |
getCellValue(org.apache.poi.ss.usermodel.Row row,
int column)
获取单元格值
|
<E> java.util.List<E> |
getDataList(java.lang.Class<E> cls,
int... groups)
获取导入数据列表
|
int |
getDataRowNum()
获取数据行号
|
int |
getLastCellNum()
获取最后一个列号
|
int |
getLastDataRowNum()
获取最后一个数据行号
|
org.apache.poi.ss.usermodel.Row |
getRow(int rownum)
获取行对象
|
void |
validateGroups(java.lang.Class<?>... validateGroups) |
public ExcelImport(java.lang.String fileName,
int headerNum)
throws java.io.IOException
fileName - 导入文件,读取第一个工作表headerNum - 标题行号,数据行号=标题行号+1java.io.IOException - IOExceptionpublic ExcelImport(java.io.File file,
int headerNum)
throws java.io.IOException
file - 导入文件对象,读取第一个工作表headerNum - 标题行号,数据行号=标题行号+1java.io.IOException - IOExceptionpublic ExcelImport(java.lang.String fileName,
int headerNum,
int sheetIndex)
throws java.io.IOException
fileName - 导入文件headerNum - 标题行号,数据行号=标题行号+1sheetIndex - 工作表编号java.io.IOException - IOExceptionpublic ExcelImport(java.io.File file,
int headerNum,
int sheetIndex)
throws java.io.IOException
file - 导入文件对象headerNum - 标题行号,数据行号=标题行号+1sheetIndex - 工作表编号java.io.IOException - IOExceptionpublic ExcelImport(org.springframework.web.multipart.MultipartFile multipartFile,
int headerNum,
int sheetIndex)
throws java.io.IOException
multipartFile - 导入文件对象headerNum - 标题行号,数据行号=标题行号+1sheetIndex - 工作表编号java.io.IOException - IOExceptionpublic ExcelImport(java.lang.String fileName,
java.io.InputStream is,
int headerNum,
int sheetIndex)
throws java.io.IOException
is - isfileName - 导入文件对象headerNum - 标题行号,数据行号=标题行号+1sheetIndex - 工作表编号java.io.IOException - IOExceptionpublic org.apache.poi.ss.usermodel.Row getRow(int rownum)
rownum - rownumpublic int getDataRowNum()
public int getLastDataRowNum()
public int getLastCellNum()
public java.lang.Object getCellValue(org.apache.poi.ss.usermodel.Row row,
int column)
row - 获取的行column - 获取单元格列号public <E> java.util.List<E> getDataList(java.lang.Class<E> cls,
int... groups)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
ExcelImportException
E - Ecls - 导入对象类型groups - 导入分组java.lang.InstantiationException - InstantiationExceptionjava.lang.IllegalAccessException - IllegalAccessExceptionjava.lang.NoSuchMethodException - NoSuchMethodExceptionExcelImportException - ExcelImportExceptionpublic void validateGroups(java.lang.Class<?>... validateGroups)
validateGroups - 验证 groups