Represents a tabular structure that holds rows of example data for parameters named via the column headers:
|header 1|header 2| .... |header n| |value 11|value 12| .... |value 1n| ... |value m1|value m2| .... |value mn|
Different header and value column separators can be specified to replace the default separator "|":
!!header 1!!header 2!! .... !!header n!! !value 11!value 12! .... !value 1n! ... !value m1!value m2| .... !value mn!
Rows starting with an ignorable separator are allowed and ignored:
|header 1|header 2| .... |header n| |-- A commented row --| |value 11|value 12| .... |value 1n| ... |-- Another commented row --| |value m1|value m2| .... |value mn|
Ignorable separator is configurable and defaults to "|--".
The separators are also configurable via inlined properties:
{ignorableSeparator=!--,headerSeparator=!,valueSeparator=!} !header 1!header 2! .... !header n! !-- A commented row --! !value 11!value 12! .... !value 1n! ... !-- Another commented row --! !value m1!value m2! .... !value mn!
By default all column values are trimmed. To avoid trimming the values, use the "trim" inlined property:
{trim=false} | header 1 | header 2 | .... | header n | | value 11 | value 12 | .... | value 1n |
Comments is column values are supported via the "commentSeparator" inlined property:
{commentSeparator=#} | header 1#comment | header 2 | .... | header n | | value 11#comment | value 12 | .... | value 1n |Comments including the separator are stripped.
The table allows the retrieval of row values as converted parameters. Use {@link #getRowAsParameters(int)} and invoke{@link Parameters#valueAs(String,Class)} specifying the header and the classtype of the parameter.
The table allows the transformation of its string representation via the "transformer" inlined property:
{transformer=myTransformerName} |header 1|header 2| .... |header n| |value 11|value 12| .... |value 1n| ... |value m1|value m2| .... |value mn|The transformer needs to be registered by name via the {@link TableTransformers#useTransformer(String,TableTransformer)}. A few transformers are already registered by default in {@link TableTransformers}.
Once created, the table row can be modified, via the {@link #withRowValues(int,Map)} method, by specifying the map of row valuesto be changed.
A table can also be created by providing the entire data content, via the {@link #withRows(List
The parsing code assumes that the number of columns for data rows is the same as in the header, if a row has less fields, the remaining are filled with empty values, if it has more, the fields are ignored.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|