Provides general utility methods for controlling the display of references.
Currently, this class contains methods for "pretty printing" an array or
Collection, methods for truncating the string value of a reference
at a configured or specified length, methods for displaying an alternate
value when a specified value is null, a method for generating whitespace,
a "printf" type of method for formatting messages, and
methods for forcing values into "cells" of equal size (via truncation or
padding with whitespace).

format

message

Uses MessageFormat to format the specified String with
the specified arguments. If there are no arguments, then the String
is returned directly. Please note that the format
required here is quite different from that of
printf(String,Object...).

Since:

VelocityTools 2.0

printf

Uses String#format(Locale,String,Object... to format the specified String
with the specified arguments. Please note that the format
required here is quite different from that of
message(String,Object...).

truncate

Limits the string value of 'truncateMe' to the configured max length
in characters (default is 30 characters).
If the string gets curtailed, the configured suffix
(default is "...") is used as the ending of the truncated string.

truncate

Limits the string value of 'truncateMe' to the configured max length
in characters (default is 30 characters).
If the string gets curtailed, the specified suffix
is used as the ending of the truncated string.

cell

Truncates or pads the string value of the specified object as necessary
to ensure that the returned string's length equals the default cell size.
If truncation is necessary, the specified suffix will replace the end of
the string value to indicate that.

Parameters:

obj - the value to be put in the 'cell'

suffix - the suffix to put at the end of any values that need truncating
to indicate that they've been truncated

plural

Builds plural form of a passed word if 'value' is plural, otherwise
returns 'singular'. Plural form is built using some basic English
language rules for nouns which does not guarantee correct syntax of a
result in all cases.

getProperty

Safely retrieves the specified property from the specified object.
Subclasses that wish to perform more advanced, efficient, or just
different property retrieval methods should override this method to do
so.