org.apache.commons.lang.builder
public class StandardToStringStyle extends ToStringStyle
Works with {@link ToStringBuilder} to create a toString
.
This class is intended to be used as a singleton. There is no need to instantiate a new style each time. Simply instantiate the class once, customize the values as required, and store the result in a public static final variable for the rest of the program to access.
Since: 1.0
Version: $Id: StandardToStringStyle.java 161243 2005-04-14 04:30:28Z ggregory $
Constructor Summary | |
---|---|
StandardToStringStyle() Constructor. |
Method Summary | |
---|---|
String | getArrayEnd() Gets the array end text. |
String | getArraySeparator() Gets the array separator text. |
String | getArrayStart() Gets the array start text. |
String | getContentEnd() Gets the content end text. |
String | getContentStart() Gets the content start text. |
String | getFieldNameValueSeparator() Gets the field name value separator text. |
String | getFieldSeparator() Gets the field separator text. |
String | getNullText() Gets the text to output when |
String | getSizeEndText()
Gets the end text to output when a Collection ,
Map or Array size is output.
This is output after the size value. |
String | getSizeStartText() Gets the text to output when a This is output before the size value. |
String | getSummaryObjectEndText() Gets the end text to output when an This is output after the size value. |
String | getSummaryObjectStartText() Gets the start text to output when an This is output before the size value. |
boolean | isArrayContentDetail() Gets whether to output array content detail. |
boolean | isDefaultFullDetail() Gets whether to use full detail when the caller doesn't specify. |
boolean | isFieldSeparatorAtEnd() Gets whether the field separator should be added at the end of each buffer. |
boolean | isFieldSeparatorAtStart() Gets whether the field separator should be added at the start of each buffer. |
boolean | isShortClassName() Gets whether to output short or long class names. |
boolean | isUseClassName() Gets whether to use the class name. |
boolean | isUseFieldNames() Gets whether to use the field names passed in. |
boolean | isUseIdentityHashCode() Gets whether to use the identity hash code. |
boolean | isUseShortClassName() Gets whether to output short or long class names. |
void | setArrayContentDetail(boolean arrayContentDetail) Sets whether to output array content detail. |
void | setArrayEnd(String arrayEnd) Sets the array end text.
|
void | setArraySeparator(String arraySeparator) Sets the array separator text.
|
void | setArrayStart(String arrayStart) Sets the array start text.
|
void | setContentEnd(String contentEnd) Sets the content end text.
|
void | setContentStart(String contentStart) Sets the content start text.
|
void | setDefaultFullDetail(boolean defaultFullDetail) Sets whether to use full detail when the caller doesn't specify. |
void | setFieldNameValueSeparator(String fieldNameValueSeparator) Sets the field name value separator text.
|
void | setFieldSeparator(String fieldSeparator) Sets the field separator text.
|
void | setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd) Sets whether the field separator should be added at the end of each buffer. |
void | setFieldSeparatorAtStart(boolean fieldSeparatorAtStart) Sets whether the field separator should be added at the start of each buffer. |
void | setNullText(String nullText) Sets the text to output when
|
void | setShortClassName(boolean shortClassName) Sets whether to output short or long class names. |
void | setSizeEndText(String sizeEndText) Sets the end text to output when a This is output after the size value.
|
void | setSizeStartText(String sizeStartText) Sets the start text to output when a This is output before the size value.
|
void | setSummaryObjectEndText(String summaryObjectEndText) Sets the end text to output when an This is output after the size value.
|
void | setSummaryObjectStartText(String summaryObjectStartText) Sets the start text to output when an This is output before the size value.
|
void | setUseClassName(boolean useClassName) Sets whether to use the class name. |
void | setUseFieldNames(boolean useFieldNames) Sets whether to use the field names passed in. |
void | setUseIdentityHashCode(boolean useIdentityHashCode) Sets whether to use the identity hash code. |
void | setUseShortClassName(boolean useShortClassName) Sets whether to output short or long class names. |
Constructor.
Gets the array end text.
Returns: the current array end text
Gets the array separator text.
Returns: the current array separator text
Gets the array start text.
Returns: the current array start text
Gets the content end text.
Returns: the current content end text
Gets the content start text.
Returns: the current content start text
Gets the field name value separator text.
Returns: the current field name value separator text
Gets the field separator text.
Returns: the current field separator text
Gets the text to output when null
found.
Returns: the current text to output when null
found
Collection
,
Map
or Array
size is output.
This is output after the size value.
Returns: the current end of size text
Gets the text to output when a Collection
,
Map
or Array
size is output.
This is output before the size value.
Returns: the current start of size text
Gets the end text to output when an Object
is
output in summary mode.
This is output after the size value.
Returns: the current end of summary text
Gets the start text to output when an Object
is
output in summary mode.
This is output before the size value.
Returns: the current start of summary text
Gets whether to output array content detail.
Returns: the current array content detail setting
Gets whether to use full detail when the caller doesn't specify.
Returns: the current defaultFullDetail flag
Gets whether the field separator should be added at the end of each buffer.
Returns: fieldSeparatorAtEnd flag
Since: 2.0
Gets whether the field separator should be added at the start of each buffer.
Returns: the fieldSeparatorAtStart flag
Since: 2.0
Deprecated: Use {@link #isUseShortClassName()} Method will be removed in Commons Lang 3.0.
Gets whether to output short or long class names.
Returns: the current shortClassName flag
Gets whether to use the class name.
Returns: the current useClassName flag
Gets whether to use the field names passed in.
Returns: the current useFieldNames flag
Gets whether to use the identity hash code.
Returns: the current useIdentityHashCode flag
Gets whether to output short or long class names.
Returns: the current useShortClassName flag
Since: 2.0
Sets whether to output array content detail.
Parameters: arrayContentDetail the new arrayContentDetail flag
Sets the array end text.
null
is accepted, but will be converted
to an empty String.
Parameters: arrayEnd the new array end text
Sets the array separator text.
null
is accepted, but will be converted
to an empty String.
Parameters: arraySeparator the new array separator text
Sets the array start text.
null
is accepted, but will be converted
to an empty String.
Parameters: arrayStart the new array start text
Sets the content end text.
null
is accepted, but will be converted
to an empty String.
Parameters: contentEnd the new content end text
Sets the content start text.
null
is accepted, but will be converted
to an empty String.
Parameters: contentStart the new content start text
Sets whether to use full detail when the caller doesn't specify.
Parameters: defaultFullDetail the new defaultFullDetail flag
Sets the field name value separator text.
null
is accepted, but will be converted
to an empty String.
Parameters: fieldNameValueSeparator the new field name value separator text
Sets the field separator text.
null
is accepted, but will be converted
to an empty String.
Parameters: fieldSeparator the new field separator text
Sets whether the field separator should be added at the end of each buffer.
Parameters: fieldSeparatorAtEnd the fieldSeparatorAtEnd flag
Since: 2.0
Sets whether the field separator should be added at the start of each buffer.
Parameters: fieldSeparatorAtStart the fieldSeparatorAtStart flag
Since: 2.0
Sets the text to output when null
found.
null
is accepted, but will be converted
to an empty String.
Parameters: nullText the new text to output when null
found
Deprecated: Use {@link #setUseShortClassName(boolean)} Method will be removed in Commons Lang 3.0.
Sets whether to output short or long class names.
Parameters: shortClassName the new shortClassName flag
Sets the end text to output when a Collection
,
Map
or Array
size is output.
This is output after the size value.
null
is accepted, but will be converted
to an empty String.
Parameters: sizeEndText the new end of size text
Sets the start text to output when a Collection
,
Map
or Array
size is output.
This is output before the size value.
null
is accepted, but will be converted to
an empty String.
Parameters: sizeStartText the new start of size text
Sets the end text to output when an Object
is
output in summary mode.
This is output after the size value.
null
is accepted, but will be converted to
an empty String.
Parameters: summaryObjectEndText the new end of summary text
Sets the start text to output when an Object
is
output in summary mode.
This is output before the size value.
null
is accepted, but will be converted to
an empty String.
Parameters: summaryObjectStartText the new start of summary text
Sets whether to use the class name.
Parameters: useClassName the new useClassName flag
Sets whether to use the field names passed in.
Parameters: useFieldNames the new useFieldNames flag
Sets whether to use the identity hash code.
Parameters: useIdentityHashCode the new useIdentityHashCode flag
Sets whether to output short or long class names.
Parameters: useShortClassName the new useShortClassName flag
Since: 2.0