Class AbstractTransformer

java.lang.Object
org.jxls.transform.AbstractTransformer
All Implemented Interfaces:
Transformer

public abstract class AbstractTransformer extends Object implements Transformer
Base transformer class providing basic implementation for some of the Transformer interface methods
Author:
Leonid Vysochyn
  • Field Details

  • Constructor Details

    • AbstractTransformer

      public AbstractTransformer()
  • Method Details

    • getTargetCellRef

      public List<CellRef> getTargetCellRef(CellRef cellRef)
      Specified by:
      getTargetCellRef in interface Transformer
      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:
      resetTargetCellRefs in interface Transformer
    • getCellData

      public CellData getCellData(CellRef cellRef)
      Specified by:
      getCellData in interface Transformer
    • isIgnoreColumnProps

      public boolean isIgnoreColumnProps()
    • setIgnoreColumnProps

      public void setIgnoreColumnProps(boolean ignoreColumnProps)
      Specified by:
      setIgnoreColumnProps in interface Transformer
    • isIgnoreRowProps

      public boolean isIgnoreRowProps()
    • setIgnoreRowProps

      public void setIgnoreRowProps(boolean ignoreRowProps)
      Specified by:
      setIgnoreRowProps in interface Transformer
    • getFormulaCells

      public Set<CellData> getFormulaCells()
      Specified by:
      getFormulaCells in interface Transformer
    • deleteSheet

      public boolean deleteSheet(String sheetName)
      Specified by:
      deleteSheet in interface Transformer
    • adjustTableSize

      public void adjustTableSize(CellRef ref, Size size)
      Specified by:
      adjustTableSize in interface Transformer
    • dispose

      public void dispose()
      Description copied from interface: Transformer
      Must be called after use. write() calls this method.
      Specified by:
      dispose in interface Transformer
    • writeButNotCloseStream

      public void writeButNotCloseStream() throws IOException
      Description copied from interface: Transformer
      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.
      Specified by:
      writeButNotCloseStream in interface Transformer
      Throws:
      IOException - -
    • isEvaluateFormulas

      public boolean isEvaluateFormulas()
      Description copied from interface: Transformer
      This 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:
      isEvaluateFormulas in interface Transformer
      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:
      isFullFormulaRecalculationOnOpening in interface Transformer
      Returns:
      false: do nothing, true: activate recalculation when opening
    • setFullFormulaRecalculationOnOpening

      public void setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening)
      Description copied from interface: Transformer
      If 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:
      setFullFormulaRecalculationOnOpening in interface Transformer
      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:
      setEvaluateFormulas in interface Transformer
      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:
      isForwardOnly in interface Transformer
      Returns:
      true if the transformer can process cells only in a single pass