public abstract class ExcelCellUtils extends Object
| 构造器和说明 |
|---|
ExcelCellUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
convert(Object value,
Class<T> targetClass) |
static org.apache.poi.ss.usermodel.HorizontalAlignment |
convertAlign(String align,
org.apache.poi.ss.usermodel.HorizontalAlignment defaultAlign) |
static org.apache.poi.ss.usermodel.VerticalAlignment |
convertVerAlign(String verAlign,
org.apache.poi.ss.usermodel.VerticalAlignment defaultVerAlign) |
static org.apache.poi.ss.usermodel.HorizontalAlignment |
getCellStyleAlignment(org.apache.poi.ss.usermodel.CellStyle cellStyle)
兼容低版本POI
|
static org.apache.poi.ss.usermodel.CellType |
getCellType(org.apache.poi.ss.usermodel.Cell cell)
兼容低版本POI
|
static Object |
getCellValue(org.apache.poi.ss.usermodel.Cell cell)
获取单元格的值
|
static <T> T |
getCellValue(org.apache.poi.ss.usermodel.Cell cell,
Class<T> targetClass)
获取单元格的值
|
static Object |
getCellValue(org.apache.poi.ss.usermodel.Cell cell,
ExcelCellMapping cellMapping)
获取单元格的值
|
static boolean |
isEmptyCell(org.apache.poi.ss.usermodel.Cell cell)
判断是否为空单元格
|
static void |
setCellStyle(org.apache.poi.ss.usermodel.Sheet sheet,
ExcelMapping mapping,
int headRowNum,
boolean isBeforeWriteFile)
设置列样式
|
static void |
setCellValue(org.apache.poi.ss.usermodel.Cell cell,
Object data,
ExcelCellMapping cellMapping)
设置单元格的值
|
public static boolean isEmptyCell(org.apache.poi.ss.usermodel.Cell cell)
cell - 单元格public static Object getCellValue(org.apache.poi.ss.usermodel.Cell cell)
cell - 单元格public static Object getCellValue(org.apache.poi.ss.usermodel.Cell cell, ExcelCellMapping cellMapping)
cell - 单元格cellMapping - 列映射public static <T> T getCellValue(org.apache.poi.ss.usermodel.Cell cell,
Class<T> targetClass)
T - 目标类型cell - 单元格targetClass - 目标类public static void setCellValue(org.apache.poi.ss.usermodel.Cell cell,
Object data,
ExcelCellMapping cellMapping)
throws NoSuchFieldException
cell - 单元格data - 数据cellMapping - 列映射NoSuchFieldException - 字段未找到的异常public static void setCellStyle(org.apache.poi.ss.usermodel.Sheet sheet,
ExcelMapping mapping,
int headRowNum,
boolean isBeforeWriteFile)
sheet - 表格mapping - 表格映射headRowNum - 头行号isBeforeWriteFile - 是否在写文件前public static org.apache.poi.ss.usermodel.HorizontalAlignment convertAlign(String align, @Nullable org.apache.poi.ss.usermodel.HorizontalAlignment defaultAlign)
public static org.apache.poi.ss.usermodel.VerticalAlignment convertVerAlign(String verAlign, @Nullable org.apache.poi.ss.usermodel.VerticalAlignment defaultVerAlign)
public static org.apache.poi.ss.usermodel.CellType getCellType(org.apache.poi.ss.usermodel.Cell cell)
public static org.apache.poi.ss.usermodel.HorizontalAlignment getCellStyleAlignment(org.apache.poi.ss.usermodel.CellStyle cellStyle)
Copyright © 2021–2024 EasyJ寮�婧愮ぞ鍖�. All rights reserved.