Package org.springframework.shell.table
Class Table
java.lang.Object
org.springframework.shell.table.Table
- All Implemented Interfaces:
TerminalSizeAware
This is the central API for table rendering. A Table object is constructed with a given
TableModel, which holds raw table contents. Its rendering logic is then altered by applying
various customizations, in a fashion very similar to what is used e.g. in a spreadsheet
program:
formatters
know how to derive character data out of raw data. For example, numbers are formatted according to a Locale, or Maps are emitted as a series of key=value linessize constraints
are then applied, which decide how much column real estate to allocate to cellstext wrapping policies
are applied once the column sizes are known- finally,
alignment
strategies actually render text as a series of space-padded strings that draw nicely on screen.
CellMatcher
: One can
decide to right pad column number 3, or to format in a certain way all instances of java.util.Map.
Of course, all of those customizations often work hand in hand, and not all combinations make sense: one needs to anticipate the fact that text will be split using the ' ' (space) character to properly calculate column sizes.
-
Method Summary
-
Method Details
-
getModel
-
render
- Specified by:
render
in interfaceTerminalSizeAware
-