org.apache.commons.lang.builder
Class StandardToStringStyle

java.lang.Object
  |
  +--org.apache.commons.lang.builder.ToStringStyle
        |
        +--org.apache.commons.lang.builder.StandardToStringStyle
All Implemented Interfaces:
java.io.Serializable

public class StandardToStringStyle
extends ToStringStyle

StandardToStringStyle works with 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. Your code should instantiate the class once, customize the values as required, and then store the result in a public static final variable for the rest of the program to access.

Version:
$Id: StandardToStringStyle.java,v 1.4 2002/09/22 09:18:32 scolebourne Exp $
Author:
Stephen Colebourne
See Also:
Serialized Form

Inner classes inherited from class org.apache.commons.lang.builder.ToStringStyle
ToStringStyle.DefaultToStringStyle, ToStringStyle.MultiLineToStringStyle, ToStringStyle.NoFieldNameToStringStyle, ToStringStyle.SimpleToStringStyle
 
Fields inherited from class org.apache.commons.lang.builder.ToStringStyle
arrayContentDetail, arrayEnd, arraySeparator, arrayStart, contentEnd, contentStart, DEFAULT_STYLE, defaultFullDetail, fieldNameValueSeparator, fieldSeparator, MULTI_LINE_STYLE, NO_FIELD_NAMES_STYLE, nullText, SIMPLE_STYLE, sizeEndText, sizeStartText, summaryObjectEndText, summaryObjectStartText, useClassName, useFieldNames, useIdentityHashCode, useShortClassName
 
Constructor Summary
StandardToStringStyle()
          Constructor.
 
Method Summary
 java.lang.String getArrayEnd()
          Gets the array end text.
 java.lang.String getArraySeparator()
          Gets the array separator text.
 java.lang.String getArrayStart()
          Gets the array start text.
 java.lang.String getContentEnd()
          Gets the content end text.
 java.lang.String getContentStart()
          Gets the content start text.
 java.lang.String getFieldNameValueSeparator()
          Gets the field name value separator text.
 java.lang.String getFieldSeparator()
          Gets the field separator text.
 java.lang.String getNullText()
          Gets the text to output when null found.
 java.lang.String getSizeEndText()
          Gets the text to output when a Collection, Map or Array size is output.
 java.lang.String getSizeStartText()
          Gets the text to output when a Collection, Map or Array size is output.
 java.lang.String getSummaryObjectEndText()
          Gets the text to output when an Object is output in summary mode.
 java.lang.String getSummaryObjectStartText()
          Gets the text to output when an Object is output in summary mode.
 boolean isArrayContentDetail()
          Gets whether to output array content detail.
 boolean isDefaultFullDetail()
          Gets whether to use full detail when the caller doesn't specify.
 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.
 void setArrayContentDetail(boolean arrayContentDetail)
          Sets whether to output array content detail.
 void setArrayEnd(java.lang.String arrayEnd)
          Sets the array end text.
 void setArraySeparator(java.lang.String arraySeparator)
          Sets the array separator text.
 void setArrayStart(java.lang.String arrayStart)
          Sets the array start text.
 void setContentEnd(java.lang.String contentEnd)
          Sets the content end text.
 void setContentStart(java.lang.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(java.lang.String fieldNameValueSeparator)
          Sets the field name value separator text.
 void setFieldSeparator(java.lang.String fieldSeparator)
          Sets the field separator text.
 void setNullText(java.lang.String nullText)
          Sets the text to output when null found.
 void setShortClassName(boolean shortClassName)
          Sets whether to output short or long class names.
 void setSizeEndText(java.lang.String sizeEndText)
          Sets the text to output when a Collection, Map or Array size is output.
 void setSizeStartText(java.lang.String sizeStartText)
          Sets the text to output when a Collection, Map or Array size is output.
 void setSummaryObjectEndText(java.lang.String summaryObjectEndText)
          Sets the text to output when an Object is output in summary mode.
 void setSummaryObjectStartText(java.lang.String summaryObjectStartText)
          Sets the text to output when an Object is output in summary mode.
 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.
 
Methods inherited from class org.apache.commons.lang.builder.ToStringStyle
append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, appendClassName, appendContentEnd, appendContentStart, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendEnd, appendFieldEnd, appendFieldSeparator, appendFieldStart, appendIdentityHashCode, appendInternal, appendNullText, appendStart, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummarySize, getShortClassName, isFullDetail
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

StandardToStringStyle

public StandardToStringStyle()
Constructor.
Method Detail

isUseClassName

public boolean isUseClassName()
Gets whether to use the class name.
Overrides:
isUseClassName in class ToStringStyle
Returns:
the current useClassName flag

setUseClassName

public void setUseClassName(boolean useClassName)
Sets whether to use the class name.
Overrides:
setUseClassName in class ToStringStyle
Parameters:
useClassName - the new useClassName flag

isShortClassName

public boolean isShortClassName()
Gets whether to output short or long class names.
Overrides:
isShortClassName in class ToStringStyle
Returns:
the current shortClassName flag

setShortClassName

public void setShortClassName(boolean shortClassName)
Sets whether to output short or long class names.
Overrides:
setShortClassName in class ToStringStyle
Parameters:
shortClassName - the new shortClassName flag

isUseIdentityHashCode

public boolean isUseIdentityHashCode()
Gets whether to use the identity hash code.
Overrides:
isUseIdentityHashCode in class ToStringStyle
Returns:
the current useIdentityHashCode flag

setUseIdentityHashCode

public void setUseIdentityHashCode(boolean useIdentityHashCode)
Sets whether to use the identity hash code.
Overrides:
setUseIdentityHashCode in class ToStringStyle
Parameters:
useIdentityHashCode - the new useIdentityHashCode flag

isUseFieldNames

public boolean isUseFieldNames()
Gets whether to use the field names passed in.
Overrides:
isUseFieldNames in class ToStringStyle
Returns:
the current useFieldNames flag

setUseFieldNames

public void setUseFieldNames(boolean useFieldNames)
Sets whether to use the field names passed in.
Overrides:
setUseFieldNames in class ToStringStyle
Parameters:
useFieldNames - the new useFieldNames flag

isDefaultFullDetail

public boolean isDefaultFullDetail()
Gets whether to use full detail when the caller doesn't specify.
Overrides:
isDefaultFullDetail in class ToStringStyle
Returns:
the current defaultFullDetail flag

setDefaultFullDetail

public void setDefaultFullDetail(boolean defaultFullDetail)
Sets whether to use full detail when the caller doesn't specify.
Overrides:
setDefaultFullDetail in class ToStringStyle
Parameters:
defaultFullDetail - the new defaultFullDetail flag

isArrayContentDetail

public boolean isArrayContentDetail()
Gets whether to output array content detail.
Overrides:
isArrayContentDetail in class ToStringStyle
Returns:
the current array content detail setting

setArrayContentDetail

public void setArrayContentDetail(boolean arrayContentDetail)
Sets whether to output array content detail.
Overrides:
setArrayContentDetail in class ToStringStyle
Parameters:
arrayContentDetail - the new arrayContentDetail flag

getArrayStart

public java.lang.String getArrayStart()
Gets the array start text.
Overrides:
getArrayStart in class ToStringStyle
Returns:
the current array start text

setArrayStart

public void setArrayStart(java.lang.String arrayStart)
Sets the array start text. Null is accepted, but will be converted to a blank string.
Overrides:
setArrayStart in class ToStringStyle
Parameters:
arrayStart - the new array start text

getArrayEnd

public java.lang.String getArrayEnd()
Gets the array end text.
Overrides:
getArrayEnd in class ToStringStyle
Returns:
the current array end text

setArrayEnd

public void setArrayEnd(java.lang.String arrayEnd)
Sets the array end text. Null is accepted, but will be converted to a blank string.
Overrides:
setArrayEnd in class ToStringStyle
Parameters:
arrayEnd - the new array end text

getArraySeparator

public java.lang.String getArraySeparator()
Gets the array separator text.
Overrides:
getArraySeparator in class ToStringStyle
Returns:
the current array separator text

setArraySeparator

public void setArraySeparator(java.lang.String arraySeparator)
Sets the array separator text. Null is accepted, but will be converted to a blank string.
Overrides:
setArraySeparator in class ToStringStyle
Parameters:
arraySeparator - the new array separator text

getContentStart

public java.lang.String getContentStart()
Gets the content start text.
Overrides:
getContentStart in class ToStringStyle
Returns:
the current content start text

setContentStart

public void setContentStart(java.lang.String contentStart)
Sets the content start text. Null is accepted, but will be converted to a blank string.
Overrides:
setContentStart in class ToStringStyle
Parameters:
contentStart - the new content start text

getContentEnd

public java.lang.String getContentEnd()
Gets the content end text.
Overrides:
getContentEnd in class ToStringStyle
Returns:
the current content end text

setContentEnd

public void setContentEnd(java.lang.String contentEnd)
Sets the content end text. Null is accepted, but will be converted to a blank string.
Overrides:
setContentEnd in class ToStringStyle
Parameters:
contentEnd - the new content end text

getFieldNameValueSeparator

public java.lang.String getFieldNameValueSeparator()
Gets the field name value separator text.
Overrides:
getFieldNameValueSeparator in class ToStringStyle
Returns:
the current field name value separator text

setFieldNameValueSeparator

public void setFieldNameValueSeparator(java.lang.String fieldNameValueSeparator)
Sets the field name value separator text. Null is accepted, but will be converted to a blank string.
Overrides:
setFieldNameValueSeparator in class ToStringStyle
Parameters:
fieldNameValueSeparator - the new field name value separator text

getFieldSeparator

public java.lang.String getFieldSeparator()
Gets the field separator text.
Overrides:
getFieldSeparator in class ToStringStyle
Returns:
the current field separator text

setFieldSeparator

public void setFieldSeparator(java.lang.String fieldSeparator)
Sets the field separator text. Null is accepted, but will be converted to a blank string.
Overrides:
setFieldSeparator in class ToStringStyle
Parameters:
fieldSeparator - the new field separator text

getNullText

public java.lang.String getNullText()
Gets the text to output when null found.
Overrides:
getNullText in class ToStringStyle
Returns:
the current text to output when null found

setNullText

public void setNullText(java.lang.String nullText)
Sets the text to output when null found. Null is accepted, but will be converted to a blank string.
Overrides:
setNullText in class ToStringStyle
Parameters:
nullText - the new text to output when null found

getSizeStartText

public java.lang.String getSizeStartText()
Gets the text to output when a Collection, Map or Array size is output. This is output before the size value.
Overrides:
getSizeStartText in class ToStringStyle
Returns:
the current start of size text

setSizeStartText

public void setSizeStartText(java.lang.String sizeStartText)
Sets the 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 a blank string.
Overrides:
setSizeStartText in class ToStringStyle
Parameters:
sizeStartText - the new start of size text

getSizeEndText

public java.lang.String getSizeEndText()
Gets the text to output when a Collection, Map or Array size is output. This is output after the size value.
Overrides:
getSizeEndText in class ToStringStyle
Returns:
the current end of size text

setSizeEndText

public void setSizeEndText(java.lang.String sizeEndText)
Sets the 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 a blank string.
Overrides:
setSizeEndText in class ToStringStyle
Parameters:
sizeEndText - the new end of size text

getSummaryObjectStartText

public java.lang.String getSummaryObjectStartText()
Gets the text to output when an Object is output in summary mode. This is output before the size value.
Overrides:
getSummaryObjectStartText in class ToStringStyle
Returns:
the current start of summary text

setSummaryObjectStartText

public void setSummaryObjectStartText(java.lang.String summaryObjectStartText)
Sets the 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 a blank string.
Overrides:
setSummaryObjectStartText in class ToStringStyle
Parameters:
summaryObjectStartText - the new start of summary text

getSummaryObjectEndText

public java.lang.String getSummaryObjectEndText()
Gets the text to output when an Object is output in summary mode. This is output after the size value.
Overrides:
getSummaryObjectEndText in class ToStringStyle
Returns:
the current end of summary text

setSummaryObjectEndText

public void setSummaryObjectEndText(java.lang.String summaryObjectEndText)
Sets the 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 a blank string.
Overrides:
setSummaryObjectEndText in class ToStringStyle
Parameters:
summaryObjectEndText - the new end of summary text


Copyright (c) 2001-2002 - Apache Software Foundation