public abstract class ExcelCellUtils extends Object
| Constructor and Description |
|---|
ExcelCellUtils() |
| Modifier and Type | Method and Description |
|---|---|
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 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)
Copyright © 2021–2022 EasyJ????. All rights reserved.