@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class FormattableColumn extends java.lang.Object implements java.io.Serializable
ColumnFormatter.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CSV_QUOTE_ESCAPE_CHARACTER_PROPERTY
A system property that can be used to specify what character should be used
when escaping quotation marks in the output.
|
| Constructor and Description |
|---|
FormattableColumn(int width,
HorizontalAlignment alignment,
java.lang.String... labelLines)
Creates a new formattable column with the provided information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
format(java.lang.StringBuilder buffer,
java.lang.String text,
OutputFormat format)
Appends a formatted representation of the provided text to the given
buffer.
|
HorizontalAlignment |
getAlignment()
Retrieves the alignment for this column.
|
java.lang.String[] |
getLabelLines()
Retrieves the lines to use as the label for this column.
|
java.lang.String |
getSingleLabelLine()
Retrieves a single-line representation of the label.
|
int |
getWidth()
Retrieves the width for this column.
|
static void |
setCSVQuoteEscapeCharacter(char c)
Specifies the character that should be used to escape the double quote
character in CSV-formatted values.
|
java.lang.String |
toString()
Retrieves a string representation of this formattable column.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this formattable column to the provided
buffer.
|
@NotNull public static final java.lang.String CSV_QUOTE_ESCAPE_CHARACTER_PROPERTY
public FormattableColumn(int width, @NotNull HorizontalAlignment alignment, @NotNull java.lang.String... labelLines)
width - The width to use for this column. It must be greater
than or equal to 1.alignment - The alignment to use for this column. It must not be
null.labelLines - The lines to use as the label for this column. It must
not be null.public int getWidth()
@NotNull public HorizontalAlignment getAlignment()
@NotNull public java.lang.String[] getLabelLines()
@NotNull public java.lang.String getSingleLabelLine()
public void format(@NotNull java.lang.StringBuilder buffer, @NotNull java.lang.String text, @NotNull OutputFormat format)
buffer - The buffer to which the text should be appended. It must
not be null.text - The text to append to the buffer. It must not be
null.format - The format to use for the text. It must not be
null.public static void setCSVQuoteEscapeCharacter(char c)
com.unboundid.util.FormattableColumn.csvQuoteEscapeCharacter system
property set to a value that contains only the backslash character.c - The character to use to escape the double quote character in
CSV-formatted values. This is only recommended to be the
double quote character or the backslash character.@NotNull public java.lang.String toString()
toString in class java.lang.Object