Class AbstractRowHandler<T>

java.lang.Object
org.aoju.bus.office.excel.sax.AbstractRowHandler<T>
Type Parameters:
T - 转换后的数据类型
All Implemented Interfaces:
RowHandler
Direct Known Subclasses:
BeanRowHandler, MapRowHandler

public abstract class AbstractRowHandler<T> extends Object implements RowHandler
抽象行数据处理器,通过实现handle(int, long, List) 处理原始数据 并调用handleData(int, long, Object)处理经过转换后的数据。
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • startRowIndex

      protected final int startRowIndex
      读取起始行(包含,从0开始计数)
    • endRowIndex

      protected final int endRowIndex
      读取结束行(包含,从0开始计数)
    • convertFunc

      protected org.aoju.bus.core.lang.function.XFunction<List<Object>,T> convertFunc
      行数据转换函数
  • Constructor Details

    • AbstractRowHandler

      public AbstractRowHandler(int startRowIndex, int endRowIndex)
      构造
      Parameters:
      startRowIndex - 读取起始行(包含,从0开始计数)
      endRowIndex - 读取结束行(包含,从0开始计数)
  • Method Details

    • handle

      public void handle(int sheetIndex, long rowIndex, List<Object> rowCells)
      Description copied from interface: RowHandler
      处理一行数据
      Specified by:
      handle in interface RowHandler
      Parameters:
      sheetIndex - 当前Sheet序号
      rowIndex - 当前行号,从0开始计数
      rowCells - 行数据,每个Object表示一个单元格的值
    • handleData

      public abstract void handleData(int sheetIndex, long rowIndex, T data)
      处理转换后的数据
      Parameters:
      sheetIndex - 当前Sheet序号
      rowIndex - 当前行号,从0开始计数
      data - 行数据