public class SheetTransformer
extends java.lang.Object
SheetTransformer
knows how to transform one
Sheet
in an Excel spreadsheet. For cell processing, it creates
a Block
representing the entire Sheet
, then it
delegates processing to a BlockTransformer
. It is also
responsible for gathering all Formulas
at the beginning, and
replacing all Formulas
with Excel Formulas at the end. It also
exposes the "sheet" object in the "beans" Map
.Modifier and Type | Class | Description |
---|---|---|
static interface |
SheetTransformer.AfterOffSheetProperties |
Specifies a callback interface that is called after all off-sheet
properties are set.
|
Constructor | Description |
---|---|
SheetTransformer() |
Modifier and Type | Method | Description |
---|---|---|
void |
gatherFormulasAndTagLocations(org.apache.poi.ss.usermodel.Sheet sheet,
java.util.Map<java.lang.String,Formula> formulaMap,
java.util.Map<java.lang.String,java.lang.String> tagLocationsMap) |
Searches for all
Formulas contained on the given
Sheet . |
void |
replaceFormulas(org.apache.poi.ss.usermodel.Sheet sheet,
WorkbookContext context) |
Replace all
Formulas found in the given Sheet
with Excel formulas. |
void |
transform(org.apache.poi.ss.usermodel.Sheet sheet,
WorkbookContext context,
java.util.Map<java.lang.String,java.lang.Object> beans) |
Transforms the given
Sheet , using the given Map
of bean names to bean objects. |
void |
transform(org.apache.poi.ss.usermodel.Sheet sheet,
WorkbookContext context,
java.util.Map<java.lang.String,java.lang.Object> beans,
SheetCloner cloner) |
Transforms the given
Sheet , using the given Map
of bean names to bean objects. |
public void transform(org.apache.poi.ss.usermodel.Sheet sheet, WorkbookContext context, java.util.Map<java.lang.String,java.lang.Object> beans)
Sheet
, using the given Map
of bean names to bean objects.sheet
- The Sheet
to transform.context
- The WorkbookContext
.beans
- The beans map.public void transform(org.apache.poi.ss.usermodel.Sheet sheet, WorkbookContext context, java.util.Map<java.lang.String,java.lang.Object> beans, SheetCloner cloner)
Sheet
, using the given Map
of bean names to bean objects.sheet
- The Sheet
to transform.context
- The WorkbookContext
.beans
- The beans map.cloner
- An optional SheetCloner
. This
is only present so the ExcelTransformer
, as the caller of
this method, can safely apply certain off-sheet properties that XSSF
doesn't retain after the sheet name is changed.public void gatherFormulasAndTagLocations(org.apache.poi.ss.usermodel.Sheet sheet, java.util.Map<java.lang.String,Formula> formulaMap, java.util.Map<java.lang.String,java.lang.String> tagLocationsMap)
Formulas
contained on the given
Sheet
. Adds them to the given formula map. Searches for
tags on the given Sheet
. Adds them to the given tag
locations map.sheet
- The Sheet
on which to search for
Formulas
.formulaMap
- A Map
of strings to Formulas
,
with the keys of the format "sheetName!formulaText".tagLocationsMap
- A Map
of cell reference strings to
original cell reference strings.public void replaceFormulas(org.apache.poi.ss.usermodel.Sheet sheet, WorkbookContext context)
Formulas
found in the given Sheet
with Excel formulas.sheet
- The Sheet
.context
- The WorkbookContext
.Copyright © 2012–2018 Jett Team. All rights reserved.