Class AsciiDocTable
- java.lang.Object
-
- org.forgerock.api.markup.asciidoc.AsciiDocTable
-
public class AsciiDocTable extends Object
AsciiDoc table builder [ref], which defers insertion of the table, at the end of the parent document, untiltableEnd()
is called.This class is not thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description static int
COLUMN_WIDTH_MEDIUM
Medium column-width (2xCOLUMN_WIDTH_SMALL
) for use withcolumnWidths(int...)
.static int
COLUMN_WIDTH_SMALL
Small column-width for use withcolumnWidths(int...)
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsciiDocTable
columnCell(String columnCell)
Inserts a column-cell.AsciiDocTable
columnCell(String columnCell, AsciiDocTableColumnStyles style)
Inserts a column-cell, with a style.AsciiDocTable
columnsPerRow(int columnsPerRow)
Sets number of columns per row, which is implicitly set byheaders(String...)
andcolumnWidths(int...)
.AsciiDocTable
columnWidths(int... columnWidths)
Sets the widths for all columns-per-row, which can be a proportional integer (the default is 1) or a percentage (1 to 99).AsciiDocTable
columnWidths(List<Integer> columnWidths)
Sets the widths for all columns-per-row, which can be a proportional integer (the default is 1) or a percentage (1 to 99).AsciiDocTable
headers(String... columnHeaders)
Sets the column headers, where blank entries can be null/empty, but the length of the headers array must be equal to the number of columns in the table.AsciiDocTable
headers(List<String> columnHeaders)
Sets the column headers, where blank entries can be null/empty, but the length of the headers array must be equal to the number of columns in the table.AsciiDocTable
rowEnd()
Adds an optional space to visually delineate the end of a row in the generated markup.AsciiDoc
tableEnd()
Completes the table being built, and inserts it at the end of the parent document.AsciiDocTable
title(String title)
Sets a table-title.
-
-
-
Field Detail
-
COLUMN_WIDTH_SMALL
public static final int COLUMN_WIDTH_SMALL
Small column-width for use withcolumnWidths(int...)
.- See Also:
- Constant Field Values
-
COLUMN_WIDTH_MEDIUM
public static final int COLUMN_WIDTH_MEDIUM
Medium column-width (2xCOLUMN_WIDTH_SMALL
) for use withcolumnWidths(int...)
.- See Also:
- Constant Field Values
-
-
Method Detail
-
title
public AsciiDocTable title(String title)
Sets a table-title.- Parameters:
title
- Table-title- Returns:
- Table builder
-
headers
public AsciiDocTable headers(List<String> columnHeaders)
Sets the column headers, where blank entries can be null/empty, but the length of the headers array must be equal to the number of columns in the table.- Parameters:
columnHeaders
- Column headers- Returns:
- Table builder
-
headers
public AsciiDocTable headers(String... columnHeaders)
Sets the column headers, where blank entries can be null/empty, but the length of the headers array must be equal to the number of columns in the table.- Parameters:
columnHeaders
- Column headers- Returns:
- Table builder
-
columnsPerRow
public AsciiDocTable columnsPerRow(int columnsPerRow)
Sets number of columns per row, which is implicitly set byheaders(String...)
andcolumnWidths(int...)
.This value can only be set once.
- Parameters:
columnsPerRow
- Columns per row- Returns:
- Table builder
-
columnWidths
public AsciiDocTable columnWidths(List<Integer> columnWidths)
Sets the widths for all columns-per-row, which can be a proportional integer (the default is 1) or a percentage (1 to 99).- Parameters:
columnWidths
- An entry for each column-per row in value range [1,99]- Returns:
- Table builder
-
columnWidths
public AsciiDocTable columnWidths(int... columnWidths)
Sets the widths for all columns-per-row, which can be a proportional integer (the default is 1) or a percentage (1 to 99).- Parameters:
columnWidths
- An entry for each column-per row in value range [1,99]- Returns:
- Table builder
-
columnCell
public AsciiDocTable columnCell(String columnCell)
Inserts a column-cell.- Parameters:
columnCell
- Column-cell ornull
for empty cell- Returns:
- Table builder
-
columnCell
public AsciiDocTable columnCell(String columnCell, AsciiDocTableColumnStyles style)
Inserts a column-cell, with a style.- Parameters:
columnCell
- Column-cell ornull
for empty cellstyle
- Column-style- Returns:
- Table builder
-
rowEnd
public AsciiDocTable rowEnd()
Adds an optional space to visually delineate the end of a row in the generated markup. The intention is that this method would be called after adding all columns for a given row.- Returns:
- table builder
-
tableEnd
public AsciiDoc tableEnd()
Completes the table being built, and inserts it at the end of the parent document.- Returns:
- Doc builder
-
-