Class AsciiDocTable


  • public class AsciiDocTable
    extends Object
    AsciiDoc table builder [ref], which defers insertion of the table, at the end of the parent document, until tableEnd() is called.

    This class is not thread-safe.

    • 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 by headers(String...) and columnWidths(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 or null 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 or null for empty cell
        style - 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