public class TransformerDelegator extends Object implements Transformer
| Modifier and Type | Field and Description |
|---|---|
protected Transformer |
transformer |
| Constructor and Description |
|---|
TransformerDelegator(Transformer transformer) |
| Modifier and Type | Method and Description |
|---|---|
void |
addImage(AreaRef areaRef,
byte[] imageBytes,
ImageType imageType) |
void |
addImage(AreaRef areaRef,
byte[] imageBytes,
ImageType imageType,
Double scaleX,
Double scaleY) |
void |
adjustTableSize(CellRef ref,
Size size) |
protected void |
beforeWrite() |
void |
clearCell(CellRef cellRef) |
boolean |
deleteSheet(String sheetName) |
void |
dispose()
Must be called after use.
|
CellData |
getCellData(CellRef cellRef) |
List<CellData> |
getCommentedCells() |
Set<CellData> |
getFormulaCells() |
List<CellRef> |
getTargetCellRef(CellRef cellRef) |
TransformationConfig |
getTransformationConfig() |
boolean |
isEvaluateFormulas()
This property is used to recalculate all formulas before saving the workbook.
|
boolean |
isForwardOnly() |
boolean |
isFullFormulaRecalculationOnOpening() |
void |
mergeCells(CellRef ref,
int rows,
int cols) |
void |
resetArea(AreaRef areaRef) |
void |
resetTargetCellRefs() |
void |
setEvaluateFormulas(boolean evaluateFormulas)
This property is used to recalculate all formulas before saving the workbook.
|
void |
setFormula(CellRef cellRef,
String formulaString) |
void |
setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening)
If you set this option to true, all formulas will be recalculated when the file is opened in MS Excel.
|
void |
setHidden(String sheetName,
boolean hidden) |
void |
setTransformationConfig(TransformationConfig transformationConfig) |
void |
transform(CellRef srcCellRef,
CellRef targetCellRef,
Context context,
boolean updateRowHeight) |
void |
updateRowHeight(String srcSheetName,
int srcRowNum,
String targetSheetName,
int targetRowNum) |
void |
write()
Writes Excel workbook to output stream and disposes the workbook.
|
void |
writeButNotCloseStream()
Writes Excel workbook to output stream but not close the stream
designed to use with ZipOutputStream or other OutputStream
for creates several xls files one time.
|
protected final Transformer transformer
public TransformerDelegator(Transformer transformer)
public void setTransformationConfig(TransformationConfig transformationConfig)
setTransformationConfig in interface Transformerpublic TransformationConfig getTransformationConfig()
getTransformationConfig in interface Transformerpublic void transform(CellRef srcCellRef, CellRef targetCellRef, Context context, boolean updateRowHeight)
transform in interface Transformerprotected void beforeWrite()
public void write()
throws IOException
Transformerwrite in interface TransformerIOException - -public void dispose()
Transformerdispose in interface Transformerpublic void setFormula(CellRef cellRef, String formulaString)
setFormula in interface Transformerpublic Set<CellData> getFormulaCells()
getFormulaCells in interface Transformerpublic CellData getCellData(CellRef cellRef)
getCellData in interface Transformerpublic List<CellRef> getTargetCellRef(CellRef cellRef)
getTargetCellRef in interface TransformercellRef - a source cell referencepublic void resetTargetCellRefs()
resetTargetCellRefs in interface Transformerpublic void resetArea(AreaRef areaRef)
resetArea in interface Transformerpublic void clearCell(CellRef cellRef)
clearCell in interface Transformerpublic List<CellData> getCommentedCells()
getCommentedCells in interface Transformerpublic void addImage(AreaRef areaRef, byte[] imageBytes, ImageType imageType)
addImage in interface Transformerpublic boolean deleteSheet(String sheetName)
deleteSheet in interface Transformerpublic void setHidden(String sheetName, boolean hidden)
setHidden in interface Transformerpublic void updateRowHeight(String srcSheetName, int srcRowNum, String targetSheetName, int targetRowNum)
updateRowHeight in interface Transformerpublic void adjustTableSize(CellRef ref, Size size)
adjustTableSize in interface Transformerpublic void mergeCells(CellRef ref, int rows, int cols)
mergeCells in interface Transformerpublic void writeButNotCloseStream()
throws IOException
TransformerwriteButNotCloseStream in interface TransformerIOException - -public boolean isEvaluateFormulas()
TransformerisEvaluateFormulas in interface Transformerworkbook.getCreationHelper().createFormulaEvaluator().evaluateAll()
before writing the workbook. Please have a look at the POI documentation for more details.
This does not work for streaming.
Please be aware that POI supports only a subset of Excel formulas.
If an unsupported formula is in the template the evaluation will fail.
false (default): do nothing (hopefully MS Excel will recalculate all formulas while opening the file)
public void setEvaluateFormulas(boolean evaluateFormulas)
TransformersetEvaluateFormulas in interface TransformerevaluateFormulas - true: calls workbook.getCreationHelper().createFormulaEvaluator().evaluateAll()
before writing the workbook. Please have a look at the POI documentation for more details.
This does not work for streaming.
Please be aware that POI supports only a subset of Excel formulas.
If an unsupported formula is in the template the evaluation will fail.
false (default): do nothing (hopefully MS Excel will recalculate all formulas while opening the file)
public boolean isFullFormulaRecalculationOnOpening()
isFullFormulaRecalculationOnOpening in interface Transformerpublic void setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening)
TransformersetFullFormulaRecalculationOnOpening in interface TransformerfullFormulaRecalculationOnOpening - false: do nothing (default value),
true: activate recalculation when openingpublic boolean isForwardOnly()
isForwardOnly in interface TransformerCopyright © 2021. All rights reserved.