R - 输入数据的行数据类型public abstract class BaseExcelReader<R>
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected java.util.function.Consumer |
beanConsumer
记录处理对象
|
protected boolean |
debugOutput |
protected java.util.Map<java.lang.Integer,PropertyConfig> |
fetchColumns |
protected SheetConfig |
sheetConfig |
| 构造器和说明 |
|---|
BaseExcelReader() |
BaseExcelReader(java.util.function.Consumer<?> beanConsumer) |
BaseExcelReader(SheetConfig sheetConfig) |
BaseExcelReader(SheetConfig sheetConfig,
java.util.function.Consumer<?> beanConsumer) |
BaseExcelReader(SheetConfig sheetConfig,
java.util.List<?> rows,
java.util.function.Consumer<?> beanConsumer) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected java.lang.Object |
converExp(java.lang.Object s,
PropertyConfig p) |
protected abstract java.lang.String |
getCellAsString(R row,
int idx) |
java.util.List |
getRows()
返回解析的记录列表
|
SheetConfig |
getSheetConfig() |
protected abstract java.util.List<java.lang.Integer> |
indexsOfRow(R row)
返回列的索引范围列表
|
protected abstract boolean |
isEmptyCell(R row,
int idx)
行由idx指定单元为空返回
true,否则返回false |
protected boolean |
moreEmptyCheck(R row) |
void |
read(java.io.File file)
从指定的文件导入Excel格式数据
|
abstract void |
read(java.io.InputStream inputStream,
java.nio.charset.Charset charset,
java.lang.String format)
从
InputStream将导入数据记录 |
protected void |
read(java.util.Iterator<R> itor)
遍历导入数据保存到
rows |
void |
read(org.springframework.web.multipart.MultipartFile uplodFile)
从WEB上传文件导入数据到
|
void |
read(java.lang.String file)
从指定的文件导入Excel格式数据
|
protected java.lang.Object |
readFrom(R record,
int idx,
PropertyConfig p)
从行记录指定的索引读取单元数据
|
void |
setRows(java.util.List rows) |
void |
setSheetConfig(SheetConfig sheetConfig) |
protected SheetConfig sheetConfig
protected final java.util.function.Consumer beanConsumer
protected java.util.Map<java.lang.Integer,PropertyConfig> fetchColumns
protected boolean debugOutput
public BaseExcelReader(SheetConfig sheetConfig, java.util.List<?> rows, java.util.function.Consumer<?> beanConsumer)
sheetConfig - rows - beanConsumer - 记录处理对象,为null则将记录保存到rowspublic BaseExcelReader(SheetConfig sheetConfig)
public BaseExcelReader(SheetConfig sheetConfig, java.util.function.Consumer<?> beanConsumer)
public BaseExcelReader(java.util.function.Consumer<?> beanConsumer)
public BaseExcelReader()
public SheetConfig getSheetConfig()
public void setSheetConfig(SheetConfig sheetConfig)
public void read(java.io.File file)
throws java.io.IOException
outputStream - java.io.IOExceptionpublic void read(java.lang.String file)
throws java.io.IOException
outputStream - java.io.IOExceptionpublic void read(org.springframework.web.multipart.MultipartFile uplodFile)
throws java.io.IOException
uplodFile - java.io.IOExceptionpublic java.util.List getRows()
public void setRows(java.util.List rows)
protected boolean moreEmptyCheck(R row)
protected java.lang.Object converExp(java.lang.Object s,
PropertyConfig p)
protected java.lang.Object readFrom(R record, int idx, PropertyConfig p)
record - idx - p - public abstract void read(java.io.InputStream inputStream,
java.nio.charset.Charset charset,
java.lang.String format)
throws java.io.IOException
InputStream将导入数据记录inputStream - charset - 数据编码为null使用默认值format - 文件格式,即文件后缀: .xls,xlxs,.cxvjava.io.IOExceptionprotected abstract java.lang.String getCellAsString(R row, int idx)
protected abstract boolean isEmptyCell(R row, int idx)
true,否则返回falserow - idx - protected abstract java.util.List<java.lang.Integer> indexsOfRow(R row)
row - Copyright © 2024. All Rights Reserved.