org.apache.poi.ss.util
Class SheetBuilder

java.lang.Object
  extended by 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

Constructor Summary
SheetBuilder(Workbook workbook, java.lang.Object[][] cells)
           
 
Method Summary
 Sheet build()
          Builds sheet from parent workbook and 2D array with cell values.
 boolean getCreateEmptyCells()
           
 void setCellValue(Cell cell, java.lang.Object value)
          Sets the cell value using object type information.
 SheetBuilder setCreateEmptyCells(boolean shouldCreateEmptyCells)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SheetBuilder

public SheetBuilder(Workbook workbook,
                    java.lang.Object[][] cells)
Method Detail

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:

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 change
value - value to set


Copyright 2011 The Apache Software Foundation or its licensors, as applicable.