Interface Transformer

All Known Implementing Classes:
AbstractTransformer, TransformerDelegator

public interface Transformer
Defines interface methods for Excel operations
Author:
Leonid Vysochyn
  • Method Details

    • transform

      void transform(CellRef srcCellRef, CellRef targetCellRef, Context context, boolean updateRowHeight)
    • setOutputStream

      void setOutputStream(OutputStream outputStream)
    • writeButNotCloseStream

      void writeButNotCloseStream() throws IOException
      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.
      Throws:
      IOException - -
    • write

      void write() throws IOException
      Writes Excel workbook to output stream and disposes the workbook.
      Throws:
      IOException - -
    • dispose

      void dispose()
      Must be called after use. write() calls this method.
    • setFormula

      void setFormula(CellRef cellRef, String formulaString)
    • getFormulaCells

      Set<CellData> getFormulaCells()
    • getCellData

      CellData getCellData(CellRef cellRef)
    • getTargetCellRef

      List<CellRef> getTargetCellRef(CellRef cellRef)
      Parameters:
      cellRef - a source cell reference
      Returns:
      a list of cell references into which the source cell was transformed
    • resetTargetCellRefs

      void resetTargetCellRefs()
    • resetArea

      void resetArea(AreaRef areaRef)
    • clearCell

      void clearCell(CellRef cellRef)
    • getCommentedCells

      List<CellData> getCommentedCells()
    • deleteSheet

      boolean deleteSheet(String sheetName)
    • setHidden

      void setHidden(String sheetName, boolean hidden)
    • updateRowHeight

      void updateRowHeight(String srcSheetName, int srcRowNum, String targetSheetName, int targetRowNum)
    • adjustTableSize

      void adjustTableSize(CellRef ref, Size size)
    • isEvaluateFormulas

      boolean isEvaluateFormulas()
      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.
      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)

    • setEvaluateFormulas

      void setEvaluateFormulas(boolean evaluateFormulas)
      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.
      Parameters:
      evaluateFormulas - 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

      boolean isFullFormulaRecalculationOnOpening()
      Returns:
      false: do nothing, true: activate recalculation when opening
    • setFullFormulaRecalculationOnOpening

      void setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening)
      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.
      Parameters:
      fullFormulaRecalculationOnOpening - false: do nothing (default value), true: activate recalculation when opening
    • isForwardOnly

      boolean isForwardOnly()
      Returns:
      true if the transformer can process cells only in a single pass
    • getLogger

      JxlsLogger getLogger()
      Returns:
      never null
    • setLogger

      void setLogger(JxlsLogger logger)
      Parameters:
      logger - not null
    • setIgnoreColumnProps

      void setIgnoreColumnProps(boolean ignoreColumnProps)
    • setIgnoreRowProps

      void setIgnoreRowProps(boolean ignoreRowProps)