Package io.keikai.range.impl.imexp
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
Common exporting behavior for both XLSX and XLS.
- Since:
- 3.5.0
- Author:
- kuro, Hawk
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected io.keikai.range.impl.imexp.ExportPhaseprotected static final intprotected SBookprotected Map<SCellStyle,org.apache.poi.ss.usermodel.CellStyle> The map stores the exportedCellStyleduring exporting, so that we can reuse them for exporting other cells.protected Map<STableStyle,org.apache.poi.ss.usermodel.TableStyle> protected org.apache.poi.ss.usermodel.WorkbookExporting destination, POI book model -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPOIDxfCellStyle(SExtraStyle extraStyle) Add DxfCellStyle as poi Dxf.protected voidaddPOITableStyle(STableStyle tableStyle) Add TableStyle as poi TableStyleprotected abstract org.apache.poi.ss.usermodel.Workbookvoidexport(SBook book, OutputStream fos) Export the model according to reversed depended order: book, sheet, defined name, cells, chart, pictures, validation.protected abstract voidexportAutoFilter(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected voidexportCell(org.apache.poi.ss.usermodel.Row poiRow, SCell cell) protected abstract voidexportChart(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected abstract voidexportColumnArray(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet, SColumnArray columnArr) protected abstract voidexportConditionalFormatting(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected abstract voidexportExtLst(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected voidexportMergedRegions(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected voidexportNamedRange(SBook book) protected abstract voidexportPassword(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected abstract voidexportPicture(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected voidexportPictureData(SBook book) protected voidprotected voidexportRowColumn(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected voidexportSheet(SSheet sheet) protected abstract voidexportSheetPr(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected voidexportSheetProtection(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) POI SheetProtection.protected abstract intexportTables(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet, int tbId) protected abstract voidexportValidation(SSheet sheet, org.apache.poi.ss.usermodel.Sheet poiSheet) protected abstract voidexportWorkbookProtection(SWorkbookProtection workbookProtection) protected StringgetFormulaString(SCell cell) protected booleanReturns whether export cached value into excel file.voidsetExportCache(boolean b) Set whether export cached value into excel file(must be called before export() is called.protected org.apache.poi.ss.usermodel.CellStyletoPOICellStyle(SCellStyle cellStyle) protected org.apache.poi.ss.usermodel.ColortoPOIColor(SColor color) protected org.apache.poi.ss.usermodel.CellStyletoPOIDefaultCellStyle(SCellStyle cellStyle) protected org.apache.poi.ss.usermodel.FontConvert ZSS Font into POI Font.protected org.apache.poi.ss.usermodel.NamedStyletoPOINamedStyle(SNamedStyle cellStyle) protected org.apache.poi.ss.usermodel.RichTextStringtoPOIRichText(SRichText richText) Methods inherited from class io.keikai.range.impl.imexp.AbstractExporter
export, export, export
-
Field Details
-
DEFAULT_ROW_HEIGHT
protected static final int DEFAULT_ROW_HEIGHT- See Also:
-
workbook
protected org.apache.poi.ss.usermodel.Workbook workbookExporting destination, POI book model -
sbook
-
styleTable
The map stores the exportedCellStyleduring exporting, so that we can reuse them for exporting other cells. -
fontTable
-
colorTable
-
exportedPicDataMap
-
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
-
exportChart
-
exportPicture
-
exportValidation
-
exportAutoFilter
-
exportSheetPr
-
exportExtLst
-
exportPassword
-
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
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 exportfos- the output stream to store data- Throws:
IOException
-
exportPictureData
-
exportNamedRange
-
exportSheet
-
exportMergedRegions
-
exportRowColumn
-
exportRow
-
exportCell
-
getFormulaString
-
toPOIRichText
-
toPOINamedStyle
-
toPOIDefaultCellStyle
-
toPOICellStyle
-
toPOIColor
-
toPOIFont
Convert ZSS Font into POI Font. Cache font in the fontTable. If font exist, don't create a new one.- Parameters:
font-- Returns:
-
exportSheetProtection
POI SheetProtection.- Parameters:
sheet- destination sheetpoiSheet- 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
Add DxfCellStyle as poi Dxf.- Parameters:
extraStyle-- Since:
- 3.8.2
-
addPOITableStyle
Add TableStyle as poi TableStyle- Parameters:
tableStyle-- Since:
- 3.8.3
-