类 AxolotlExcelReader<T>

java.lang.Object
cn.toutatis.xvoid.axolotl.excel.AxolotlExcelReader<T>

public class AxolotlExcelReader<T> extends Object
Excel读取器
作者:
Toutatis_Gc
  • 构造器详细资料

    • AxolotlExcelReader

      public AxolotlExcelReader(File excelFile)
      构造文件读取器
    • AxolotlExcelReader

      public AxolotlExcelReader(File excelFile, boolean withDefaultConfig)
    • AxolotlExcelReader

      public AxolotlExcelReader(File excelFile, Class<T> clazz)
    • AxolotlExcelReader

      public AxolotlExcelReader(File excelFile, Class<T> clazz, boolean withDefaultConfig)
      [ROOT] 构造文件读取器
      参数:
      excelFile - Excel工作簿文件
      withDefaultConfig - 是否使用默认配置
  • 方法详细资料

    • readSheetDataAsObject

      public <RT> RT readSheetDataAsObject(ReaderConfig<RT> readerConfig)
      [ROOT] 读取Excel文件数据为一个实体
      类型参数:
      RT - 读取类型
      参数:
      readerConfig - 读取配置
      返回:
      读取的数据
    • readSheetData

      public List<T> readSheetData()
    • readSheetData

      public List<T> readSheetData(int start)
    • readSheetData

      public List<T> readSheetData(int start, int end)
    • readSheetData

      public List<T> readSheetData(int start, int end, int initialRowPositionOffset)
    • readSheetData

      public <RT> List<RT> readSheetData(Class<RT> castClass, String sheetName)
    • readSheetData

      public <RT> List<RT> readSheetData(Class<RT> castClass, int sheetIndex)
    • readSheetData

      public <RT> List<RT> readSheetData(Class<RT> castClass)
    • readSheetData

      public <RT> List<RT> readSheetData(Class<RT> castClass, int sheetIndex, boolean withDefaultConfig, int startIndex, int endIndex, int initialRowPositionOffset)
      读取指定sheet的数据
      类型参数:
      RT - 类型泛型
      参数:
      castClass - 读取的类型
      sheetIndex - sheet索引
      withDefaultConfig - 是否使用默认配置
      startIndex - 起始行
      endIndex - 结束行
      initialRowPositionOffset - 起始行偏移量
      返回:
      读取的数据
    • readSheetData

      public <RT> List<RT> readSheetData(ReadConfigBuilder<RT> configBuilder)
      使用读取配置构建读取配置
      类型参数:
      RT - 读取的类型泛型
      参数:
      configBuilder - 读取配置构建器
      返回:
      读取数据
    • readSheetData

      public <RT> List<RT> readSheetData(ReaderConfig<RT> readerConfig)
      [ROOT] 读取Excel数据
      类型参数:
      RT - 读取的类型泛型
      参数:
      readerConfig - 读取配置
      返回:
      读取数据
    • getPhysicalRowNumber

      public int getPhysicalRowNumber()
    • getRecordRowNumber

      public int getRecordRowNumber()
    • getRowNumber

      public int getRowNumber(boolean isPhysical)
      获取行数
      参数:
      isPhysical - 是否是物理行数
      返回:
      行数
    • getRowNumber

      public int getRowNumber(ReaderConfig<?> readerConfig, boolean isPhysical)
      获取行数
      参数:
      readerConfig - 读取配置
      isPhysical - 是否是物理行数
      返回:
      行数
    • getPhysicalRowNumber

      public int getPhysicalRowNumber(ReaderConfig<?> readerConfig)
    • getRecordRowNumber

      public int getRecordRowNumber(ReaderConfig<?> readerConfig)
    • getRowNumber

      public int getRowNumber(int sheetIndex, boolean isPhysical)
      [ROOT] 获取行数
      参数:
      sheetIndex - 表索引
      isPhysical - 是否是物理行数
      返回:
      行数
    • getHumanReadablePosition

      public String getHumanReadablePosition()