public class FormatHelper extends Object
Formatting methods
Modifiers | Name | Description |
---|---|---|
static MetaClassRegistry |
metaRegistry |
Type Params | Return Type | Name and description |
---|---|---|
|
public static void |
append(Appendable out, Object object) Appends an object to an Appendable using Groovy's default representation for the object. |
|
public static String |
escapeBackslashes(String orig) |
|
public static String |
format(Object arguments, boolean verbose) |
|
public static String |
format(Object arguments, boolean inspect, boolean escapeBackslashes) |
|
public static String |
format(Object arguments, boolean verbose, int maxSize) |
|
public static String |
format(Object arguments, boolean inspect, boolean escapeBackslashes, int maxSize) |
|
public static String |
format(Object arguments, boolean verbose, int maxSize, boolean safe) |
|
public static String |
format(Object arguments, boolean inspect, boolean escapeBackslashes, int maxSize, boolean safe) |
|
public static String |
inspect(Object self) |
|
public static String |
toArrayString(Object[] arguments) A helper method to return the string representation of an array of objects with brace boundaries "[" and "]". |
|
public static String |
toArrayString(Object[] arguments, int maxSize, boolean safe) A helper method to return the string representation of an array of objects with brace boundaries "[" and "]". |
|
public static String |
toListString(Collection arg) A helper method to return the string representation of a list with bracket boundaries "[" and "]". |
|
public static String |
toListString(Collection arg, int maxSize) A helper method to return the string representation of a list with bracket boundaries "[" and "]". |
|
public static String |
toListString(Collection arg, int maxSize, boolean safe) A helper method to return the string representation of a list with bracket boundaries "[" and "]". |
|
public static String |
toMapString(Map arg) A helper method to return the string representation of a map with bracket boundaries "[" and "]". |
|
public static String |
toMapString(Map arg, int maxSize) A helper method to return the string representation of a map with bracket boundaries "[" and "]". |
|
public static String |
toString(Object arguments) |
|
public static String |
toString(Map<String, Object> options, Object arguments) Output the toString for the argument(s) with various options to configure.
|
|
public static String |
toTypeString(Object[] arguments) A helper method to format the arguments types as a comma-separated list. |
|
public static String |
toTypeString(Object[] arguments, int maxSize) A helper method to format the arguments types as a comma-separated list. |
|
public static void |
write(Writer out, Object object) Writes an object to a Writer using Groovy's default representation for the object. |
Appends an object to an Appendable using Groovy's default representation for the object.
A helper method to return the string representation of an array of objects with brace boundaries "[" and "]".
arguments
- the array to processA helper method to return the string representation of an array of objects with brace boundaries "[" and "]".
arguments
- the array to processmaxSize
- stop after approximately this many characters and append '...'safe
- whether to use a default object representation for any item in the array if an exception occurs when generating its toStringA helper method to return the string representation of a list with bracket boundaries "[" and "]".
arg
- the collection to processA helper method to return the string representation of a list with bracket boundaries "[" and "]".
arg
- the collection to processmaxSize
- stop after approximately this many characters and append '...'A helper method to return the string representation of a list with bracket boundaries "[" and "]".
arg
- the collection to processmaxSize
- stop after approximately this many characters and append '...', -1 means don't stopsafe
- whether to use a default object representation for any item in the collection if an exception occurs when generating its toStringA helper method to return the string representation of a map with bracket boundaries "[" and "]".
arg
- the map to processA helper method to return the string representation of a map with bracket boundaries "[" and "]".
arg
- the map to processmaxSize
- stop after approximately this many characters and append '...', -1 means don't stop Output the toString
for the argument(s) with various options to configure.
Configuration options:
toString
throws an exception, in which case the exception is swallowed and a dumber default toString
is usedtoString
, otherwise use its inspect
valueinspect
and escapeBackslashes
options
- a map of configuration optionsarguments
- the argument(s) to calculate the toString
forA helper method to format the arguments types as a comma-separated list.
arguments
- the type to processA helper method to format the arguments types as a comma-separated list.
arguments
- the type to processmaxSize
- stop after approximately this many characters and append '...', -1 means don't stop