org.apache.poi.ss.util
Class SheetBuilder
java.lang.Object
org.apache.poi.ss.util.SheetBuilder
public class SheetBuilder
- extends java.lang.Object
Class that provides useful sheet build capabilities. It can be used
in test cases to improve readability or in Swing applications with
tables.
- Author:
- Roman Kashitsyn
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SheetBuilder
public SheetBuilder(Workbook workbook,
java.lang.Object[][] cells)
getCreateEmptyCells
public boolean getCreateEmptyCells()
- Returns:
- true if null objects should be trated as empty cells
false otherwise
setCreateEmptyCells
public SheetBuilder setCreateEmptyCells(boolean shouldCreateEmptyCells)
- Parameters:
shouldCreateEmptyCells
- true if null array elements should be
trated as empty cells
- Returns:
- this
build
public Sheet build()
- Builds sheet from parent workbook and 2D array with cell
values. Creates rows anyway (even if row contains only null
cells), creates cells only if corresponding property is true.
The conversion is performed in the following way:
- Numbers become numeric cells.
java.util.Date
or java.util.Calendar
instances become date cells.
- String with leading '=' char become formulas (leading '='
trancated).
- Other objects become strings via
Object.toString()
method.
- Returns:
- newly created sheet
setCellValue
public void setCellValue(Cell cell,
java.lang.Object value)
- Sets the cell value using object type information.
- Parameters:
cell
- cell to changevalue
- value to set
Copyright 2011 The Apache Software Foundation or
its licensors, as applicable.