Package org.jxls.transform
Class AbstractTransformer
java.lang.Object
org.jxls.transform.AbstractTransformer
- All Implemented Interfaces:
Transformer
Base transformer class providing basic implementation for some of the
Transformer interface methods- Author:
- Leonid Vysochyn
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustTableSize(CellRef ref, Size size) booleandeleteSheet(String sheetName) voiddispose()Must be called after use.getCellData(CellRef cellRef) getTargetCellRef(CellRef cellRef) booleanThis property is used to recalculate all formulas before saving the workbook.booleanbooleanbooleanbooleanvoidvoidsetEvaluateFormulas(boolean evaluateFormulas) This option does not work for streaming.voidsetFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening) If you set this option to true, all formulas will be recalculated when the file is opened in MS Excel.voidsetIgnoreColumnProps(boolean ignoreColumnProps) voidsetIgnoreRowProps(boolean ignoreRowProps) voidWrites 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jxls.transform.Transformer
clearCell, getCommentedCells, getLogger, resetArea, setFormula, setHidden, setLogger, setOutputStream, transform, updateRowHeight, write
-
Field Details
-
sheetMap
-
-
Constructor Details
-
AbstractTransformer
public AbstractTransformer()
-
-
Method Details
-
getTargetCellRef
- Specified by:
getTargetCellRefin interfaceTransformer- Parameters:
cellRef- a source cell reference- Returns:
- a list of cell references into which the source cell was transformed
-
resetTargetCellRefs
public void resetTargetCellRefs()- Specified by:
resetTargetCellRefsin interfaceTransformer
-
getCellData
- Specified by:
getCellDatain interfaceTransformer
-
isIgnoreColumnProps
public boolean isIgnoreColumnProps() -
setIgnoreColumnProps
public void setIgnoreColumnProps(boolean ignoreColumnProps) - Specified by:
setIgnoreColumnPropsin interfaceTransformer
-
isIgnoreRowProps
public boolean isIgnoreRowProps() -
setIgnoreRowProps
public void setIgnoreRowProps(boolean ignoreRowProps) - Specified by:
setIgnoreRowPropsin interfaceTransformer
-
getFormulaCells
- Specified by:
getFormulaCellsin interfaceTransformer
-
deleteSheet
- Specified by:
deleteSheetin interfaceTransformer
-
adjustTableSize
- Specified by:
adjustTableSizein interfaceTransformer
-
dispose
public void dispose()Description copied from interface:TransformerMust be called after use. write() calls this method.- Specified by:
disposein interfaceTransformer
-
writeButNotCloseStream
Description copied from interface:TransformerWrites 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.- Specified by:
writeButNotCloseStreamin interfaceTransformer- Throws:
IOException- -
-
isEvaluateFormulas
public boolean isEvaluateFormulas()Description copied from interface:TransformerThis property is used to recalculate all formulas before saving the workbook. This property is set to true if you don't open the file with MS Excel and just read it (e.g. with a unit test). The following documentation is POI specific.- Specified by:
isEvaluateFormulasin interfaceTransformer- Returns:
- 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)
-
isFullFormulaRecalculationOnOpening
public boolean isFullFormulaRecalculationOnOpening()- Specified by:
isFullFormulaRecalculationOnOpeningin interfaceTransformer- Returns:
- false: do nothing, true: activate recalculation when opening
-
setFullFormulaRecalculationOnOpening
public void setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening) Description copied from interface:TransformerIf you set this option to true, all formulas will be recalculated when the file is opened in MS Excel. This changes the Excel file. This only works once.- Specified by:
setFullFormulaRecalculationOnOpeningin interfaceTransformer- Parameters:
fullFormulaRecalculationOnOpening- false: do nothing (default value), true: activate recalculation when opening
-
setEvaluateFormulas
public void setEvaluateFormulas(boolean evaluateFormulas) This option does not work for streaming.- Specified by:
setEvaluateFormulasin interfaceTransformer- Parameters:
evaluateFormulas- false: formulas will be evaluated by MS Excel when opening the Excel file; true (default): evaluate formulas before writing.
-
isForwardOnly
public boolean isForwardOnly()- Specified by:
isForwardOnlyin interfaceTransformer- Returns:
- true if the transformer can process cells only in a single pass
-