| 程序包 | 说明 |
|---|---|
| org.ttzero.excel.entity | |
| org.ttzero.excel.entity.csv | |
| org.ttzero.excel.entity.e7 | |
| org.ttzero.excel.processor | |
| org.ttzero.excel.reader |
| 限定符和类型 | 字段和说明 |
|---|---|
Cell[] |
Row.cells |
| 限定符和类型 | 方法和说明 |
|---|---|
Cell[] |
Row.calloc(int n)
分配指定大小的连续单元格并初始化
|
Cell[] |
Row.getCells() |
Cell[] |
Row.malloc(int n)
分配指定大小的连续单元格
|
Cell[] |
Row.realloc(int n)
比较并重分配连续
n个单元格,此方法会比较传入的参数n与当前单元格数量比较,
当n大于当前数量时才进行重分配 |
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
ICellValueAndStyle.conversion(Row row,
Cell cell,
Object o,
Column hc)
动态转换单元格的值
|
protected void |
SimpleSheet.datetimeCell(Cell cell)
日期类型添加默认format
|
default void |
ICellValueAndStyle.downloadRemoteResource(Row row,
Cell cell,
String e,
Column hc,
Class<?> clazz)
下载远程资源
注意:默认情况下仅将单元格类型标记为
REMOTE_URL并不会去下载资源。 |
protected void |
TemplateSheet.fillValue(Row row,
Cell cell,
TemplateSheet.PreCell pn,
Column emptyColumn) |
default void |
ICellValueAndStyle.reset(Row row,
Cell cell,
Object e,
Column hc)
重置单元格的值和样式,Row和Cell都是内存共享的,所以每个单元格均需要重置值和样式
|
default void |
ICellValueAndStyle.setCellValue(Row row,
Cell cell,
Object e,
Column hc,
Class<?> clazz,
boolean hasConversion)
设置单元格的值,如果有动态转换器则调用转换器
|
default void |
ICellValueAndStyle.setNullValue(Row row,
Cell cell,
Column hc)
写
null值到单元格 |
default <T> void |
ICellValueAndStyle.setStyleDesign(T o,
Cell cell,
Column hc,
StyleProcessor<T> styleProcessor)
行级样式转换器,它的优先级最高
|
default void |
ICellValueAndStyle.unknownType(Row row,
Cell cell,
Object e,
Column hc,
Class<?> clazz)
未知类型转换,可覆写本方法以支持扩展类型
|
default void |
ICellValueAndStyle.writeAsMedia(Row row,
Cell cell,
String e,
Column hc,
Class<?> clazz)
将字符串转为
Media类型,仅当以Media类型导出时才会被执行,
支持Base64图片和图片url, |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
CSVCellValueAndStyle.setCellValue(Row row,
Cell cell,
Object e,
Column hc,
Class<?> clazz,
boolean hasConversion)
Setting cell value
|
<T> void |
CSVCellValueAndStyle.setStyleDesign(T o,
Cell cell,
Column hc,
StyleProcessor<T> styleProcessor)
Setting all cell style of the specified row
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
XMLWorksheetWriter.writeBool(Cell cell,
int row,
int col)
写布尔值
|
protected void |
XMLWorksheetWriter.writeCell(Cell cell,
int row,
int col)
写单元格
|
protected void |
XMLWorksheetWriter.writeChar(Cell cell,
int row,
int col)
写字符
|
protected void |
XMLWorksheetWriter.writeNull(Cell cell,
int row,
int col)
写空值
|
protected void |
XMLWorksheetWriter.writeNumeric(Cell cell,
int row,
int col)
写数字
|
protected void |
XMLWorksheetWriter.writeString(Cell cell,
int row,
int col)
写字符串
|
| 限定符和类型 | 方法和说明 |
|---|---|
T |
Converter.reversion(Row row,
Cell cell,
Class<?> destClazz)
输入转换器,读取Excel时将单元格的值转为指定类型
T |
Object |
Converter.None.reversion(Row row,
Cell cell,
Class<?> destClazz) |
| 限定符和类型 | 字段和说明 |
|---|---|
protected Cell[] |
Row.cells |
static Cell |
Cell.UNALLOCATED_CELL
Unallocated cell
|
| 限定符和类型 | 方法和说明 |
|---|---|
Cell |
Cell.blank() |
Cell |
Cell.clear() |
Cell[] |
Row.copyCells()
Returns deep clone cells
|
Cell[] |
Row.copyCells(int newLength)
Returns deep clone cells
|
Cell |
Cell.emptyTag() |
Cell |
Cell.from(Cell cell) |
Cell |
Grid.Scanner.Entry.getCell() |
Cell |
Row.getCell(int i)
获取单元格
Cell,获取到单元格后可用于后续取值或样式 |
Cell |
Row.getCell(String name)
获取单元格
Cell,获取到单元格后可用于后续取值或样式,如果查找不到时则返回一个空的单元格 |
protected Cell |
XMLRow.nextCell()
Loop parse cell
|
Cell |
Cell.setBinary(byte[] bytes) |
Cell |
Cell.setBool(boolean bv) |
Cell |
Cell.setByteBuffer(ByteBuffer byteBuffer) |
Cell |
Cell.setChar(char c) |
Cell |
Cell.setDate(int a) |
Cell |
Cell.setDateTime(double i) |
Cell |
Cell.setDecimal(BigDecimal mv) |
Cell |
Cell.setDouble(double dv) |
Cell |
Cell.setFormula(String formula) |
Cell |
Cell.setHyperlink(String hyperlink) |
Cell |
Cell.setInputStream(InputStream stream) |
Cell |
Cell.setInt(int nv) |
Cell |
Cell.setLong(long lv) |
Cell |
Cell.setPath(Path path) |
Cell |
Cell.setString(String sv) |
Cell |
Cell.setT(char t) |
Cell |
Cell.setTime(double t) |
| 限定符和类型 | 方法和说明 |
|---|---|
Cell |
Cell.from(Cell cell) |
Boolean |
Row.getBoolean(Cell c)
获取单元格的值并转为
Boolean类型,对于非布尔类型则兼容C语言的bool判断 |
Byte |
Row.getByte(Cell c)
获取单元格的值并转为
Byte类型 |
int |
Row.getCellStyle(Cell c)
获取单元格样式值,可以拿此返回值调用
Styles.getBorder(int)等方法获取具体的样式 |
CellType |
Row.getCellType(Cell c)
获取单元格的数据类型
注意:这里仅是一个近似的类型,因为从原始文件中只能获取到
numeric,string,
boolean三种类型。 |
Character |
Row.getChar(Cell c)
获取单元格的值并转为
Character类型 |
Date |
Row.getDate(Cell c)
获取单元格的值并转为
java.util.Date类型,整数和小数类型将以1900-1-1为基础进行计算,字符串将进行格式化处理 |
BigDecimal |
Row.getDecimal(Cell c)
获取单元格的值并转为
java.math.BigDecimal类型 |
Double |
Row.getDouble(Cell c)
获取单元格的值并转为
Double类型 |
Float |
Row.getFloat(Cell c)
获取单元格的值并转为
Float类型 |
String |
Row.getFormula(Cell cell)
获取单元格的公式
|
Integer |
Row.getInt(Cell c)
获取单元格的值并转为
Integer类型 |
LocalDate |
Row.getLocalDate(Cell c)
获取单元格的值并转为
LocalDate类型,整数和小数类型将以1900-1-1为基础进行计算,字符串将进行格式化处理 |
LocalDateTime |
Row.getLocalDateTime(Cell c)
获取单元格的值并转为
LocalDateTime类型,整数和小数类型将以1900-1-1为基础进行计算,字符串将进行格式化处理 |
LocalTime |
Row.getLocalTime(Cell c)
获取单元格的值并转为
LocalTime类型,整数和小数类型将以1900-1-1为基础进行计算,字符串将进行格式化处理 |
Long |
Row.getLong(Cell c)
获取单元格的值并转为
Long类型 |
Short |
Row.getShort(Cell c)
获取单元格的值并转为
Short类型 |
String |
Row.getString(Cell c)
获取单元格的值并转为
String类型 |
Time |
Row.getTime(Cell c)
获取单元格的值并转为
java.sql.Time类型,整数和小数类型将以1900-1-1为基础进行计算,字符串将进行格式化处理 |
Timestamp |
Row.getTimestamp(Cell c)
获取单元格的值并转为
java.sql.Timestamp类型,整数和小数类型将以1900-1-1为基础进行计算,字符串将进行格式化处理 |
boolean |
Row.hasFormula(Cell cell)
检查单元格是否包含公式
|
boolean |
Row.isBlank(Cell c)
判断单元格是否为空值
|
int |
Grid.merge(int r,
Cell cell)
Merge cell in range cells
|
int |
Grid.FastGrid.merge(int r,
Cell cell) |
int |
Grid.IndexGrid.merge(int r,
Cell cell) |
int |
Grid.FractureGrid.merge(int r,
Cell cell) |
protected void |
XMLRow.parseCellValue(Cell cell)
Parse cell value
|
Row |
Row.setCells(Cell[] cells)
Setting custom
Cell |
Row |
Row.setCells(Cell[] cells,
int fromIndex,
int toIndex)
Setting custom
Cell |
Copyright © 2024. All rights reserved.