public class BeanSheetReader<T> extends Object implements SheetReader<List<T>>
Sheet
为bean的List列表形式Constructor and Description |
---|
BeanSheetReader(int headerRowIndex,
int startRowIndex,
int endRowIndex,
Class<T> beanClass)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
addHeaderAlias(String header,
String alias)
增加标题别名
|
List<T> |
read(org.apache.poi.ss.usermodel.Sheet sheet)
读取数据
|
void |
setCellEditor(CellEditor cellEditor)
设置单元格值处理逻辑
当Excel中的值并不能满足我们的读取要求时,通过传入一个编辑接口,可以对单元格值自定义,例如对数字和日期类型值转换为字符串等 |
void |
setHeaderAlias(Map<String,String> headerAlias)
设置标题行的别名Map
|
void |
setIgnoreEmptyRow(boolean ignoreEmptyRow)
设置是否忽略空行
|
public List<T> read(org.apache.poi.ss.usermodel.Sheet sheet)
SheetReader
read
in interface SheetReader<List<T>>
sheet
- Sheet
public void setCellEditor(CellEditor cellEditor)
cellEditor
- 单元格值处理接口public void setIgnoreEmptyRow(boolean ignoreEmptyRow)
ignoreEmptyRow
- 是否忽略空行public void setHeaderAlias(Map<String,String> headerAlias)
headerAlias
- 别名MapCopyright © 2024. All rights reserved.