public class SheetBuilder
extends java.lang.Object
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.
(类 SheetBuilder 提供了一种从二维对象数组构建工作簿工作表的简单方法。它可用于测试用例以提高代码可读性或用于带有表格的 Swing 应用程序。)
Constructor and Description |
---|
SheetBuilder(Workbook workbook, java.lang.Object[][] cells) |
Modifier and Type | Method and Description |
---|---|
Sheet |
build()
Builds sheet from parent workbook and 2D array with cell values.
(从父工作簿和具有单元格值的二维数组构建工作表。)
|
boolean |
getCreateEmptyCells()
Returns
true if null array elements should be treated as empty cells.
(如果 null 数组元素应被视为空单元格,则返回 true。)
|
SheetBuilder |
setCreateEmptyCells(boolean shouldCreateEmptyCells)
Specifies if null array elements should be treated as empty cells.
(指定是否应将空数组元素视为空单元格。)
|
SheetBuilder |
setSheetName(java.lang.String sheetName)
Specifies name of the sheet to build.
(指定要构建的工作表的名称。)
|
public SheetBuilder(Workbook workbook, java.lang.Object[][] cells)
public boolean getCreateEmptyCells()
true
if null array elements should be treated as empty cells.
(如果 null 数组元素应被视为空单元格,则返回 true。)
true
if null objects should be treated as empty cells and
false
otherwise
(如果 null 对象应被视为空单元格,则为 true,否则为 false)
public SheetBuilder setCreateEmptyCells(boolean shouldCreateEmptyCells)
shouldCreateEmptyCells
-
true
if null array elements should be treated as empty cells
(shouldCreateEmptyCells - 如果 null 数组元素应被视为空单元格,则为 true)
this
(这)
public SheetBuilder setSheetName(java.lang.String sheetName)
sheetName
- sheet name to use
(sheetName - 要使用的工作表名称)
this
(这)
public Sheet build()
java.util.Date
or java.util.Calendar
instances become date cells.Object.toString()
method call.Copyright 2021 The Apache Software Foundation or its licensors, as applicable.