Class AbstractExcelExporter

java.lang.Object
io.keikai.range.impl.imexp.AbstractExporter
io.keikai.range.impl.imexp.AbstractExcelExporter
All Implemented Interfaces:
SExporter, Serializable
Direct Known Subclasses:
ExcelXlsExporter, ExcelXlsxExporter

public abstract class AbstractExcelExporter extends AbstractExporter
Common exporting behavior for both XLSX and XLS.
Since:
3.5.0
Author:
kuro, Hawk
See Also:
  • Field Details

    • DEFAULT_ROW_HEIGHT

      protected static final int DEFAULT_ROW_HEIGHT
      See Also:
    • workbook

      protected org.apache.poi.ss.usermodel.Workbook workbook
      Exporting destination, POI book model
    • sbook

      protected SBook sbook
    • styleTable

      protected Map<SCellStyle,org.apache.poi.ss.usermodel.CellStyle> styleTable
      The map stores the exported CellStyle during exporting, so that we can reuse them for exporting other cells.
    • fontTable

      protected Map<SFont,org.apache.poi.ss.usermodel.Font> fontTable
    • colorTable

      protected Map<SColor,org.apache.poi.ss.usermodel.Color> colorTable
    • exportedPicDataMap

      protected Map<Integer,Integer> exportedPicDataMap
    • tbStyleTable

      protected Map<STableStyle,org.apache.poi.ss.usermodel.TableStyle> tbStyleTable
    • _exportPhase

      protected io.keikai.range.impl.imexp.ExportPhase _exportPhase
    • _exportCache

      protected boolean _exportCache
  • Constructor Details

    • AbstractExcelExporter

      public AbstractExcelExporter()
  • Method Details

    • exportColumnArray

      protected abstract void exportColumnArray(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet, SColumnArray columnArr)
    • createPoiBook

      protected abstract org.apache.poi.ss.usermodel.Workbook createPoiBook()
    • exportWorkbookProtection

      protected abstract void exportWorkbookProtection(SWorkbookProtection workbookProtection)
    • exportChart

      protected abstract void exportChart(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportPicture

      protected abstract void exportPicture(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportValidation

      protected abstract void exportValidation(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportAutoFilter

      protected abstract void exportAutoFilter(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportSheetPr

      protected abstract void exportSheetPr(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportExtLst

      protected abstract void exportExtLst(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportPassword

      protected abstract void exportPassword(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportTables

      protected abstract int exportTables(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet, int tbId)
    • exportConditionalFormatting

      protected abstract void exportConditionalFormatting(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • export

      public void export(SBook book, OutputStream fos) throws IOException
      Export the model according to reversed depended order: book, sheet, defined name, cells, chart, pictures, validation. Because named ranges (defined names) require sheet index, they should be imported after sheets created. Besides, cells, charts, and validations may have formulas referring to named ranges, they must be imported after named ranged. Pictures depend on cells.
      Parameters:
      book - the book to export
      fos - the output stream to store data
      Throws:
      IOException
    • exportPictureData

      protected void exportPictureData(SBook book)
    • exportNamedRange

      protected void exportNamedRange(SBook book)
    • exportSheet

      protected void exportSheet(SSheet sheet)
    • exportMergedRegions

      protected void exportMergedRegions(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportRowColumn

      protected void exportRowColumn(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
    • exportRow

      protected void exportRow(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet, SRow row)
    • exportCell

      protected void exportCell(org.apache.poi.ss.usermodel.Row poiRow, SCell cell)
    • getFormulaString

      protected String getFormulaString(SCell cell)
    • toPOIRichText

      protected org.apache.poi.ss.usermodel.RichTextString toPOIRichText(SRichText richText)
    • toPOINamedStyle

      protected org.apache.poi.ss.usermodel.NamedStyle toPOINamedStyle(SNamedStyle cellStyle)
    • toPOIDefaultCellStyle

      protected org.apache.poi.ss.usermodel.CellStyle toPOIDefaultCellStyle(SCellStyle cellStyle)
    • toPOICellStyle

      protected org.apache.poi.ss.usermodel.CellStyle toPOICellStyle(SCellStyle cellStyle)
    • toPOIColor

      protected org.apache.poi.ss.usermodel.Color toPOIColor(SColor color)
    • toPOIFont

      protected org.apache.poi.ss.usermodel.Font toPOIFont(SFont font)
      Convert ZSS Font into POI Font. Cache font in the fontTable. If font exist, don't create a new one.
      Parameters:
      font -
      Returns:
    • exportSheetProtection

      protected void exportSheetProtection(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet)
      POI SheetProtection.
      Parameters:
      sheet - destination sheet
      poiSheet - source POI sheet
    • setExportCache

      public void setExportCache(boolean b)
      Set whether export cached value into excel file(must be called before export() is called.
      Parameters:
      b -
      Since:
      3.7.0
    • isExportCache

      protected boolean isExportCache()
      Returns whether export cached value into excel file.
      Returns:
      Since:
      3.7.0
    • addPOIDxfCellStyle

      protected void addPOIDxfCellStyle(SExtraStyle extraStyle)
      Add DxfCellStyle as poi Dxf.
      Parameters:
      extraStyle -
      Since:
      3.8.2
    • addPOITableStyle

      protected void addPOITableStyle(STableStyle tableStyle)
      Add TableStyle as poi TableStyle
      Parameters:
      tableStyle -
      Since:
      3.8.3