SheetBuilder provides an easy way of building workbook sheets
from 2D array of Objects. It can be used in test cases to improve code
readability or in Swing applications with tables.
| Modifier and Type | Field and Description |
|---|---|
| private final Object[][] | |
| private String | |
| private boolean | |
| private final Workbook |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Sheet | |
| public boolean | Returns: true if null objects should be treated as empty cells
and false otherwiseReturns |
| private String | |
| private boolean | |
| private void | setCellValue(Cell
cell to change cell, Object value to set value)Sets the cell value using object type information. |
| public SheetBuilder | Returns: thistrue if null array elements should be
treated as empty cellsSpecifies if null array elements should be treated as empty cells. |
| public SheetBuilder |
| cells | back to summary |
|---|---|
| private final Object[][] cells | |
| sheetName | back to summary |
|---|---|
| private String sheetName | |
| shouldCreateEmptyCells | back to summary |
|---|---|
| private boolean shouldCreateEmptyCells | |
| workbook | back to summary |
|---|---|
| private final Workbook workbook | |
| SheetBuilder | back to summary |
|---|---|
| public SheetBuilder(Workbook workbook, Object[][] cells) | |
| build | back to summary |
|---|---|
| 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 if either corresponding array value is not null or createEmptyCells property is true. The conversion is performed in the following way:
| |
| getCreateEmptyCells | back to summary |
|---|---|
| public boolean getCreateEmptyCells() Returns
| |
| getFormula | back to summary |
|---|---|
| private String getFormula(Object obj) | |
| isFormulaDefinition | back to summary |
|---|---|
| private boolean isFormulaDefinition(Object obj) | |
| setCellValue | back to summary |
|---|---|
| private void setCellValue(Cell cell, Object value) Sets the cell value using object type information. | |
| setCreateEmptyCells | back to summary |
|---|---|
| public SheetBuilder setCreateEmptyCells(boolean shouldCreateEmptyCells) Specifies if null array elements should be treated as empty cells.
| |
| setSheetName | back to summary |
|---|---|
| public SheetBuilder setSheetName(String sheetName) Specifies name of the sheet to build. If not specified, default name (provided by workbook) will be used instead.
| |