Class Excel03SaxReader

java.lang.Object
org.aoju.bus.office.excel.sax.Excel03SaxReader
All Implemented Interfaces:
ExcelSaxReader<Excel03SaxReader>, org.apache.poi.hssf.eventusermodel.HSSFListener

public class Excel03SaxReader extends Object implements org.apache.poi.hssf.eventusermodel.HSSFListener, ExcelSaxReader<Excel03SaxReader>
Excel2003格式的事件-用户模型方式读取器,统一将此归类为Sax读取
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • Excel03SaxReader

      public Excel03SaxReader(RowHandler rowHandler)
      构造
      Parameters:
      rowHandler - 行处理器
  • Method Details

    • read

      public Excel03SaxReader read(File file, String idOrRid) throws org.aoju.bus.core.exception.InternalException
      Description copied from interface: ExcelSaxReader
      开始读取Excel
      Specified by:
      read in interface ExcelSaxReader<Excel03SaxReader>
      Parameters:
      file - Excel文件
      idOrRid - Excel中的sheet id或者rid编号,rid必须加rId前缀,例如rId1,如果为-1处理所有编号的sheet
      Returns:
      this
      Throws:
      org.aoju.bus.core.exception.InternalException - POI异常
    • read

      public Excel03SaxReader read(InputStream excelStream, String idOrRid) throws org.aoju.bus.core.exception.InternalException
      Description copied from interface: ExcelSaxReader
      开始读取Excel,读取结束后并不关闭流
      Specified by:
      read in interface ExcelSaxReader<Excel03SaxReader>
      Parameters:
      excelStream - Excel流
      idOrRid - Excel中的sheet id或者rid编号,rid必须加rId前缀,例如rId1,如果为-1处理所有编号的sheet
      Returns:
      this
      Throws:
      org.aoju.bus.core.exception.InternalException - POI异常
    • read

      public Excel03SaxReader read(org.apache.poi.poifs.filesystem.POIFSFileSystem fs, String id) throws org.aoju.bus.core.exception.InternalException
      读取
      Parameters:
      fs - POIFSFileSystem
      id - sheet序号
      Returns:
      this
      Throws:
      org.aoju.bus.core.exception.InternalException - IO异常包装
    • getSheetIndex

      public int getSheetIndex()
      获得Sheet序号,如果处理所有sheet,获得最大的Sheet序号,从0开始
      Returns:
      sheet序号
    • getSheetName

      public String getSheetName()
      获得Sheet名,如果处理所有sheet,获得后一个Sheet名,从0开始
      Returns:
      Sheet名
    • processRecord

      public void processRecord(org.apache.poi.hssf.record.Record record)
      HSSFListener 监听方法,处理 Record
      Specified by:
      processRecord in interface org.apache.poi.hssf.eventusermodel.HSSFListener
      Parameters:
      record - 记录