public class DataTable extends Object
<dries@quodlibet.be>| 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 - Tablepage - PDPageIOException - If there is an error releasing resourcespublic void setTable(Table table)
Set the Table that the CSV document will be added to
table - Tablepublic Cell getHeaderCellTemplate()
Get the Cell Template that will be applied to header cells.
Cell's templatepublic 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's templatepublic 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's templatepublic Cell getFirstColumnCellTemplate()
Get the Cell Template that will be assigned to cells in the first column
Cell's templatepublic Cell getLastColumnCellTemplate()
Get the Cell Template that will be assigned to cells in the last columns
Cell's templatepublic void addListToTable(List<List> data, Boolean hasHeader) throws IOException
Add a List of Lists to the Table
data - Table's datahasHeader - boolean if Table has headerIOException - parsing errorpublic void addCsvToTable(String data, Boolean hasHeader, char separator) throws IOException
Add a String representing a CSV document to the Table
data - Table's datahasHeader - boolean if Table has headerseparator - char on which data will be parsedIOException - parsing errorCopyright © 2020. All rights reserved.