Class ExcelTool

java.lang.Object
com.xxl.tool.excel.ExcelTool

public class ExcelTool extends Object
Excel导入/导出工具 A flexible tool for translating Java objects and Excel documents.
Author:
xuxueli 2017-09-08 22:27:20
  • Constructor Details

    • ExcelTool

      public ExcelTool()
  • Method Details

    • writeFile

      public static void writeFile(String filePath, List<?>... sheetDataList)
      生成Excel,写入磁盘文件
      Parameters:
      filePath - file path
      sheetDataList - excel sheet data
    • writeByteArray

      public static byte[] writeByteArray(List<?>... sheetDataList)
      生成Excel,写入字节数组
      Parameters:
      sheetDataList - excel sheet data
    • readExcel

      public static <T> List<T> readExcel(InputStream inputStream, Class<T> sheetClass)
      从输入流读取Excel,封装成Java对象
      Parameters:
      inputStream - input stream
      sheetClass - sheet class
      Returns:
      List
    • readExcel

      public static <T> List<T> readExcel(File excelFile, Class<T> sheetClass)
      从文件读取Excel,封装成Java对象
      Parameters:
      excelFile - excel file
      sheetClass - sheet class
      Returns:
      List
    • readExcel

      public static <T> List<T> readExcel(String filePath, Class<T> sheetClass)
      从文件读取Excel,封装成Java对象
      Parameters:
      filePath - excel file path
      sheetClass - sheet class
      Returns:
      List