public abstract class ExcelConverterUtils extends Object
| 构造器和说明 |
|---|
ExcelConverterUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static IExcelConverter |
getConverter(Class<?> clazz)
获取类对应的转换器
|
static <T> org.apache.poi.ss.usermodel.Workbook |
toExcel(List<T> list,
Class<T> clazz)
列表转换为Excel的workbook实例
|
static <T> List<T> |
toList(byte[] excelFileBytes,
Class<T> clazz)
Excel文件转换为列表数据
|
static <T> List<T> |
toList(InputStream inputStream,
Class<T> clazz)
Excel文件转换为列表数据
|
@NonNull public static IExcelConverter getConverter(@NonNull Class<?> clazz) throws ConverterNotFoundException
clazz - 数据类型ConverterNotFoundException - 转换器不存在或未匹配public static <T> List<T> toList(InputStream inputStream, Class<T> clazz) throws ConvertException, ConverterNotFoundException
T - 数据类型inputStream - Excel文件流clazz - 数据类ConverterNotFoundException - 转换器不存在 或 未匹配到合适的转换器ConvertException - 转换失败的异常public static <T> List<T> toList(byte[] excelFileBytes, Class<T> clazz) throws ConvertException, ConverterNotFoundException
T - 数据类型excelFileBytes - Excel文件byte数组clazz - 数据类ConverterNotFoundException - 转换器不存在 或 未匹配到合适的转换器ConvertException - 转换失败的异常public static <T> org.apache.poi.ss.usermodel.Workbook toExcel(List<T> list, Class<T> clazz) throws ConvertException, ConverterNotFoundException
T - 数据类型list - 列表数据clazz - 数据类ConverterNotFoundException - 转换器不存在 或 未匹配到合适的转换器ConvertException - 转换失败的异常Copyright © 2021 EasyJ寮�婧愮ぞ鍖�. All rights reserved.