Package org.springframework.shell.table
Class TableBuilder
java.lang.Object
org.springframework.shell.table.TableBuilder
A builder class to incrementally configure a Table.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddFullBorder
(BorderStyle style) Set a border around each and every cell of the table.Set a border on the outline of the whole table, around the first row and draw vertical lines around each column.addHeaderBorder
(BorderStyle style) Set a border on the outline of the whole table, as well as around the first row.addInnerBorder
(BorderStyle style) Set a border on the inner verticals and horizontals of the table, but not on the outline.addOutlineBorder
(BorderStyle style) Set a border on the outline of the whole table.build()
getModel()
on
(CellMatcher matcher) paintBorder
(BorderStyle style, int match)
-
Constructor Details
-
TableBuilder
Construct a table with the given model. The table will use the following strategies for all cells, unless overridden:default formatting
using toString()sizing strategy
trying to use the maximum space, resorting to splitting lines on spaceswrapping text
on space charactersleft aligning
text.
- Parameters:
model
- the data model of the table to construct
-
-
Method Details
-
getModel
-
on
-
build
-
paintBorder
-
addOutlineBorder
Set a border on the outline of the whole table.- Parameters:
style
- the style to apply- Returns:
- this, for method chaining
-
addHeaderBorder
Set a border on the outline of the whole table, as well as around the first row.- Parameters:
style
- the style to apply- Returns:
- this, for method chaining
-
addFullBorder
Set a border around each and every cell of the table.- Parameters:
style
- the style to apply- Returns:
- this, for method chaining
-
addHeaderAndVerticalsBorders
Set a border on the outline of the whole table, around the first row and draw vertical lines around each column.- Parameters:
style
- the style to apply- Returns:
- this, for method chaining
-
addInnerBorder
Set a border on the inner verticals and horizontals of the table, but not on the outline.- Parameters:
style
- the style to apply- Returns:
- this, for method chaining
-