Package liquibase.util
Class TableOutput
- java.lang.Object
-
- liquibase.util.TableOutput
-
public class TableOutput extends Object
-
-
Constructor Summary
Constructors Constructor Description TableOutput()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Integer>computeMaxWidths(String[][] rows)Compute the size of the largest string of each column of the provided tablestatic List<Integer>computeMaxWidths(List<List<String>> rows)Compute the size of the largest string of each column of the provided tablestatic voidformatOutput(String[][] table, int[] maxWidths, boolean leftJustifiedRows, Writer writer)This method outputs the input data in a tabular format with wrapping of linesstatic voidformatOutput(String[][] table, List<Integer> maxWidths, boolean leftJustifiedRows, Writer writer)This method outputs the input data in a tabular format with wrapping of linesstatic voidformatOutput(List<List<String>> table, int[] maxWidths, boolean leftJustifiedRows, Writer writer)This method outputs the input data in a tabular format with wrapping of linesstatic voidformatOutput(List<List<String>> table, List<Integer> maxWidths, boolean leftJustifiedRows, Writer writer)This method outputs the input data in a tabular format with wrapping of linesstatic voidformatUnwrappedOutput(List<List<String>> table, boolean leftJustifiedRows, Writer writer)This method outputs the input data in a tabular format *without* wrapping of lines
-
-
-
Method Detail
-
formatUnwrappedOutput
public static void formatUnwrappedOutput(List<List<String>> table, boolean leftJustifiedRows, Writer writer) throws LiquibaseException
This method outputs the input data in a tabular format *without* wrapping of lines- Parameters:
table- 2-dimensional array of dataleftJustifiedRows- If true then add "-" to format stringwriter- Writer to use for output- Throws:
LiquibaseException
-
formatOutput
public static void formatOutput(List<List<String>> table, List<Integer> maxWidths, boolean leftJustifiedRows, Writer writer) throws LiquibaseException
This method outputs the input data in a tabular format with wrapping of lines- Parameters:
table- 2-dimensional array of datamaxWidths- Maximum widths of each column to control wrappingleftJustifiedRows- If true then add "-" to format stringwriter- Writer to use for output- Throws:
LiquibaseException
-
formatOutput
public static void formatOutput(List<List<String>> table, int[] maxWidths, boolean leftJustifiedRows, Writer writer) throws LiquibaseException
This method outputs the input data in a tabular format with wrapping of lines- Parameters:
table- 2-dimensional array of datamaxWidths- Maximum widths of each column to control wrappingleftJustifiedRows- If true then add "-" to format stringwriter- Writer to use for output- Throws:
LiquibaseException
-
formatOutput
public static void formatOutput(String[][] table, int[] maxWidths, boolean leftJustifiedRows, Writer writer) throws LiquibaseException
This method outputs the input data in a tabular format with wrapping of lines- Parameters:
table- 2-dimensional array of datamaxWidths- Maximum widths of each column to control wrappingleftJustifiedRows- If true then add "-" to format stringwriter- Writer to use for output- Throws:
LiquibaseException
-
formatOutput
public static void formatOutput(String[][] table, List<Integer> maxWidths, boolean leftJustifiedRows, Writer writer) throws LiquibaseException
This method outputs the input data in a tabular format with wrapping of lines- Parameters:
table- 2-dimensional array of datamaxWidths- Maximum widths of each column to control wrappingleftJustifiedRows- If true then add "-" to format stringwriter- Writer to use for output- Throws:
LiquibaseException
-
computeMaxWidths
public static List<Integer> computeMaxWidths(List<List<String>> rows)
Compute the size of the largest string of each column of the provided table- Parameters:
rows- the provided table to compute widths from- Returns:
- an empty immutable list if the provided table is empty
- Throws:
RuntimeException- if rows is null or the column count is not the same for every row
-
computeMaxWidths
public static List<Integer> computeMaxWidths(String[][] rows)
Compute the size of the largest string of each column of the provided table- Parameters:
rows- the provided table to compute widths from- Returns:
- an empty immutable list if the provided table is empty
- Throws:
RuntimeException- if rows is null or the column count is not the same for every row
-
-