Class AbstractListToExcelHook

java.lang.Object
icu.easyj.poi.excel.hook.AbstractListToExcelHook
All Implemented Interfaces:
IListToExcelHook

public abstract class AbstractListToExcelHook extends Object implements IListToExcelHook
列表转Excel时提供的勾子抽象类
Author:
wangliang181230
  • Constructor Details

    • AbstractListToExcelHook

      public AbstractListToExcelHook()
  • Method Details

    • onBeforeCreateHeadRow

      public void onBeforeCreateHeadRow(Map<Object,Object> context, org.apache.poi.ss.usermodel.Sheet sheet, ExcelMapping mapping)
      Description copied from interface: IListToExcelHook
      “创建头行之前” 触发的事件
      Specified by:
      onBeforeCreateHeadRow in interface IListToExcelHook
      Parameters:
      context - 表格所需上下文
      sheet - 表格
      mapping - 表格映射
    • onAfterCreateDataRows

      public void onAfterCreateDataRows(Map<Object,Object> context, org.apache.poi.ss.usermodel.Sheet sheet, ExcelMapping mapping)
      Description copied from interface: IListToExcelHook
      “创建所有数据行之后” 触发的事件
      Specified by:
      onAfterCreateDataRows in interface IListToExcelHook
      Parameters:
      context - 表格所需上下文
      sheet - 表格
      mapping - 表格映射
    • createCustomFirstRow

      protected void createCustomFirstRow(Map<Object,Object> context, org.apache.poi.ss.usermodel.Sheet sheet, ExcelMapping mapping)
      创建自定义内容的首行,并合并该所有列(注意:在头行上面的一行)
      Parameters:
      context - 表格所需的上下文
      sheet - 表格
      mapping - 表格映射
    • generateCustomFirstRowContent

      protected String generateCustomFirstRowContent(Map<Object,Object> context)
      生成首行的内容
      Parameters:
      context - 表格所需的上下文
      Returns:
      生成首行的内容
    • createCustomFooterRow

      protected void createCustomFooterRow(Map<Object,Object> context, org.apache.poi.ss.usermodel.Sheet sheet, ExcelMapping mapping)
      创建自定义内容的尾行,并合并该所有列
      Parameters:
      context - 表格所需的上下文
      sheet - 表格
      mapping - 表格映射
    • generateCustomFooterRowContent

      protected String generateCustomFooterRowContent(Map<Object,Object> context)
      生成尾行的内容
      Parameters:
      context - 表格所需的上下文
      Returns:
      生成尾行的内容
    • setCustomRowStyle

      protected void setCustomRowStyle(org.apache.poi.ss.usermodel.Cell cell, ExcelCustomRowConfig configAnno)
      设置自定义行样式
      Parameters:
      cell - 首行单元格
      configAnno - 表格映射