| 程序包 | 说明 |
|---|---|
| com.xiaoleilu.hutool.poi.excel | |
| com.xiaoleilu.hutool.poi.excel.editors |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
InternalExcelUtil.getCellValue(org.apache.poi.ss.usermodel.Cell cell,
CellEditor cellEditor)
获取单元格值
|
static Object |
InternalExcelUtil.getCellValue(org.apache.poi.ss.usermodel.Cell cell,
org.apache.poi.ss.usermodel.CellType cellType,
CellEditor cellEditor)
获取单元格值
如果单元格值为数字格式,则判断其格式中是否有小数部分,无则返回Long类型,否则返回Double类型 |
static List<Object> |
InternalExcelUtil.readRow(org.apache.poi.ss.usermodel.Row row,
CellEditor cellEditor)
读取一行
|
ExcelReader |
ExcelReader.setCellEditor(CellEditor cellEditor)
设置单元格值处理逻辑
当Excel中的值并不能满足我们的读取要求时,通过传入一个编辑接口,可以对单元格值自定义,例如对数字和日期类型值转换为字符串等 |
| 限定符和类型 | 类和说明 |
|---|---|
class |
NumericToIntEditor
POI中NUMRIC类型的值默认返回的是Double类型,此编辑器用于转换其为int型
|
class |
NumericToLongEditor
已过时。
自3.1.1开始,Hutool会自动判断单元格值为Double还是Long类型
|
class |
TrimEditor
去除String类型的单元格值两边的空格
|
Copyright © 2018. All rights reserved.