Class EasyjExcelConverter

java.lang.Object
icu.easyj.poi.excel.converter.impls.EasyjExcelConverter
All Implemented Interfaces:
IExcelConverter

@LoadLevel(name="easyj", order=10) @DependsOnClass({Excel.class,org.apache.poi.ss.usermodel.Workbook.class}) public class EasyjExcelConverter extends Object implements IExcelConverter
基于EasyJ的 IExcelConverter 实现
Author:
wangliang181230
  • Constructor Details

    • EasyjExcelConverter

      public EasyjExcelConverter()
  • Method Details

    • isMatch

      public boolean isMatch(Class<?> clazz)
      Description copied from interface: IExcelConverter
      判断是否可以使用当前实现进行转换
      Specified by:
      isMatch in interface IExcelConverter
      Parameters:
      clazz - 数据类型
      Returns:
      是否可以转换
    • toList

      public <T> List<T> toList(InputStream inputStream, Class<T> clazz) throws Exception
      Description copied from interface: IExcelConverter
      excel转换为列表
      Specified by:
      toList in interface IExcelConverter
      Type Parameters:
      T - 数据类型
      Parameters:
      inputStream - excel文件流
      clazz - 数据类
      Returns:
      list 列表数据
      Throws:
      Exception - 转换失败
    • toExcel

      public <T> org.apache.poi.ss.usermodel.Workbook toExcel(List<T> list, Class<T> clazz) throws Exception
      Description copied from interface: IExcelConverter
      列表转换为excel
      Specified by:
      toExcel in interface IExcelConverter
      Type Parameters:
      T - 数据类型
      Parameters:
      list - 数据列表
      clazz - 数据类
      Returns:
      workbook 返回excel的Workbook实例
      Throws:
      Exception - 转换失败