|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.staccatocommons.check.format.VariableFormatter
public class VariableFormatter
A formatter that creates strings that show a variable content, for debugging and error messages.
| Field Summary | |
|---|---|
static String |
DEFAULT_FORMATTING_STRING
The default formatting string. |
| Constructor Summary | |
|---|---|
VariableFormatter()
Creates a VariableFormatter with the default formatting string |
|
VariableFormatter(String formattingString)
Creates a VariableFormatter with a custom formatting string, in the
form of the formatting string expected by
String.format(String, Object...). |
|
| Method Summary | |
|---|---|
String |
format(String name,
Object value)
Creates a string that shows the content of a variable |
String |
format(String name,
Object value,
String suffix)
Creates a string that shows the content of a variable, followed by a suffix |
String |
format(String prefix,
String name,
Object value)
Creates a string that shows the content of a variable, preceded by a prefix |
String |
format(String prefix,
String name,
Object value,
String suffix)
Creates a string that shows the content of a variable, preceded by a prefix string and ended with a suffix string |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_FORMATTING_STRING
| Constructor Detail |
|---|
public VariableFormatter(String formattingString)
VariableFormatter with a custom formatting string, in the
form of the formatting string expected by
String.format(String, Object...). It must match the expression
.*\%s.*\%s.*
formattingString - public VariableFormatter()
VariableFormatter with the default formatting string
| Method Detail |
|---|
public String format(String name,
Object value)
name - the variable name. Non null.value - the variable value. Nullable
VariableFormatter
formatting string
public String format(String prefix,
String name,
Object value)
prefix - a string that will be inserted after the formatted variable A
space is inserted between them. Non nullname - the variable name. Non null.value - the variable value. Nullable
VariableFormatter
formatting string, preceded by a prefix
public String format(String name,
Object value,
String suffix)
name - the variable name. Non null.value - the variable value. Nullablesuffix - a string that will be inserted after the formatted string. A space
is inserted between them. Non null
VariableFormatter
formatting string, preceded by a prefix
public String format(String prefix,
String name,
Object value,
String suffix)
prefix - a string that will be inserted before of the formatted variable. A
space is inserted between them. Non nullname - the variable name. Non null.value - the variable value. Nullablesuffix - a string that will be inserted after the formatted variable. A
space is inserted between them. Non null
VariableFormatter
formatting string, preceded by a prefix, and ended with a suffix
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||