public class DataTable extends Object
| Modifier and Type | Field and Description |
|---|---|
static Boolean |
HASHEADER |
static Boolean |
NOHEADER |
| Constructor and Description |
|---|
DataTable(Table table,
org.apache.pdfbox.pdmodel.PDPage page)
Create a CSVTable object to be able to add CSV document to a Table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCsvToTable(String data,
Boolean hasHeader,
char separator)
Add a String representing a CSV document to the Table
|
void |
addListToTable(List<List> data,
Boolean hasHeader)
Add a List of Lists to the Table
|
Cell |
getDataCellTemplateEven()
Get the Cell Template that will be assigned to Data cells that are in even rows, and are not the first or last column
|
Cell |
getDataCellTemplateOdd()
Get the Cell Template that will be assigned to Data cells that are in odd rows, and are not the first or last column
|
Cell |
getFirstColumnCellTemplate()
Get the Cell Template that will be assigned to cells in the first column
|
Cell |
getHeaderCellTemplate()
Get the Cell Template that will be applied to header cells.
|
Cell |
getLastColumnCellTemplate()
Get the Cell Template that will be assigned to cells in the last columns
|
Table |
getTable()
Set the table to add the csv content to
|
void |
setTable(Table table)
Set the Table that the CSV document will be added to
|
public static final Boolean HASHEADER
public static final Boolean NOHEADER
public DataTable(Table table, org.apache.pdfbox.pdmodel.PDPage page) throws IOException
Create a CSVTable object to be able to add CSV document to a Table. A page needs to be passed to the constructor so the Template Cells can be created.
table - page - IOExceptionpublic Table getTable()
public void setTable(Table table)
Set the Table that the CSV document will be added to
table - public Cell getHeaderCellTemplate()
Get the Cell Template that will be applied to header cells.
public Cell getDataCellTemplateEven()
Get the Cell Template that will be assigned to Data cells that are in even rows, and are not the first or last column
public Cell getDataCellTemplateOdd()
Get the Cell Template that will be assigned to Data cells that are in odd rows, and are not the first or last column
public Cell getFirstColumnCellTemplate()
Get the Cell Template that will be assigned to cells in the first column
public Cell getLastColumnCellTemplate()
Get the Cell Template that will be assigned to cells in the last columns
public void addListToTable(List<List> data, Boolean hasHeader) throws IOException
Add a List of Lists to the Table
data - hasHeader - separator - IOExceptionpublic void addCsvToTable(String data, Boolean hasHeader, char separator) throws IOException
Add a String representing a CSV document to the Table
data - hasHeader - separator - IOExceptionCopyright © 2016. All rights reserved.