Logo Search packages:      
Sourcecode: libcommons-lang-java version File versions  Download package

org::apache::commons::lang::builder::ToStringStyle Class Reference

Inheritance diagram for org::apache::commons::lang::builder::ToStringStyle:

org::apache::commons::lang::builder::StandardToStringStyle org::apache::commons::lang::builder::ToStringStyle::DefaultToStringStyle org::apache::commons::lang::builder::ToStringStyle::MultiLineToStringStyle org::apache::commons::lang::builder::ToStringStyle::NoFieldNameToStringStyle org::apache::commons::lang::builder::ToStringStyle::SimpleToStringStyle

List of all members.


Detailed Description

Controls String formatting for ToStringBuilder. The main public interface is always via ToStringBuilder.

These classes are intended to be used as Singletons. There is no need to instantiate a new style each time. A program will generally use one of the predefined constants on this class. Alternatively, the StandardToStringStyle class can be used to set the individual settings. Thus most styles can be achieved without subclassing.

If required, a subclass can override as many or as few of the methods as it requires. Each object type (from boolean to long to Object to int[]) has its own methods to output it. Most have two versions, detail and summary.

For example, the detail version of the array based methods will output the whole array, whereas the summary method will just output the array length.

Author:
Stephen Colebourne

Gary Gregory

Pete Gieser

Since:
1.0
Version:
Id
ToStringStyle.java,v 1.27 2003/08/23 00:21:49 ggregory Exp

Definition at line 91 of file ToStringStyle.java.


Public Member Functions

void append (StringBuffer buffer, String fieldName, boolean[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, float[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, double[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, char[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, byte[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, short[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, int[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, long[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, Object[] array, Boolean fullDetail)
void append (StringBuffer buffer, String fieldName, boolean value)
void append (StringBuffer buffer, String fieldName, float value)
void append (StringBuffer buffer, String fieldName, double value)
void append (StringBuffer buffer, String fieldName, char value)
void append (StringBuffer buffer, String fieldName, byte value)
void append (StringBuffer buffer, String fieldName, short value)
void append (StringBuffer buffer, String fieldName, int value)
void append (StringBuffer buffer, String fieldName, long value)
void append (StringBuffer buffer, String fieldName, Object value, Boolean fullDetail)
void appendEnd (StringBuffer buffer, Object object)
void appendStart (StringBuffer buffer, Object object)
void appendSuper (StringBuffer buffer, String superToString)
void appendToString (StringBuffer buffer, String toString)

Static Public Attributes

static final ToStringStyle DEFAULT_STYLE = new DefaultToStringStyle()
static final ToStringStyle MULTI_LINE_STYLE = new MultiLineToStringStyle()
static final ToStringStyle NO_FIELD_NAMES_STYLE = new NoFieldNameToStringStyle()
static final ToStringStyle SIMPLE_STYLE = new SimpleToStringStyle()

Protected Member Functions

void appendClassName (StringBuffer buffer, Object object)
void appendContentEnd (StringBuffer buffer)
void appendContentStart (StringBuffer buffer)
void appendDetail (StringBuffer buffer, String fieldName, boolean[] array)
void appendDetail (StringBuffer buffer, String fieldName, float[] array)
void appendDetail (StringBuffer buffer, String fieldName, double[] array)
void appendDetail (StringBuffer buffer, String fieldName, char[] array)
void appendDetail (StringBuffer buffer, String fieldName, byte[] array)
void appendDetail (StringBuffer buffer, String fieldName, short[] array)
void appendDetail (StringBuffer buffer, String fieldName, int[] array)
void appendDetail (StringBuffer buffer, String fieldName, long[] array)
void appendDetail (StringBuffer buffer, String fieldName, Object[] array)
void appendDetail (StringBuffer buffer, String fieldName, boolean value)
void appendDetail (StringBuffer buffer, String fieldName, float value)
void appendDetail (StringBuffer buffer, String fieldName, double value)
void appendDetail (StringBuffer buffer, String fieldName, char value)
void appendDetail (StringBuffer buffer, String fieldName, byte value)
void appendDetail (StringBuffer buffer, String fieldName, short value)
void appendDetail (StringBuffer buffer, String fieldName, int value)
void appendDetail (StringBuffer buffer, String fieldName, long value)
void appendDetail (StringBuffer buffer, String fieldName, Map map)
void appendDetail (StringBuffer buffer, String fieldName, Collection coll)
void appendDetail (StringBuffer buffer, String fieldName, Object value)
void appendFieldEnd (StringBuffer buffer, String fieldName)
void appendFieldSeparator (StringBuffer buffer)
void appendFieldStart (StringBuffer buffer, String fieldName)
void appendIdentityHashCode (StringBuffer buffer, Object object)
void appendInternal (StringBuffer buffer, String fieldName, Object value, boolean detail)
void appendNullText (StringBuffer buffer, String fieldName)
void appendSummary (StringBuffer buffer, String fieldName, boolean[] array)
void appendSummary (StringBuffer buffer, String fieldName, float[] array)
void appendSummary (StringBuffer buffer, String fieldName, double[] array)
void appendSummary (StringBuffer buffer, String fieldName, char[] array)
void appendSummary (StringBuffer buffer, String fieldName, byte[] array)
void appendSummary (StringBuffer buffer, String fieldName, short[] array)
void appendSummary (StringBuffer buffer, String fieldName, int[] array)
void appendSummary (StringBuffer buffer, String fieldName, long[] array)
void appendSummary (StringBuffer buffer, String fieldName, Object[] array)
void appendSummary (StringBuffer buffer, String fieldName, Object value)
void appendSummarySize (StringBuffer buffer, String fieldName, int size)
String getArrayEnd ()
String getArraySeparator ()
String getArrayStart ()
String getContentEnd ()
String getContentStart ()
String getFieldNameValueSeparator ()
String getFieldSeparator ()
String getNullText ()
String getShortClassName (Class cls)
String getSizeEndText ()
String getSizeStartText ()
String getSummaryObjectEndText ()
String getSummaryObjectStartText ()
boolean isArrayContentDetail ()
boolean isDefaultFullDetail ()
boolean isFieldSeparatorAtEnd ()
boolean isFieldSeparatorAtStart ()
boolean isFullDetail (Boolean fullDetailRequest)
boolean isShortClassName ()
boolean isUseClassName ()
boolean isUseFieldNames ()
boolean isUseIdentityHashCode ()
boolean isUseShortClassName ()
void reflectionAppendArrayDetail (StringBuffer buffer, String fieldName, Object array)
void removeLastFieldSeparator (StringBuffer buffer)
void setArrayContentDetail (boolean arrayContentDetail)
void setArrayEnd (String arrayEnd)
void setArraySeparator (String arraySeparator)
void setArrayStart (String arrayStart)
void setContentEnd (String contentEnd)
void setContentStart (String contentStart)
void setDefaultFullDetail (boolean defaultFullDetail)
void setFieldNameValueSeparator (String fieldNameValueSeparator)
void setFieldSeparator (String fieldSeparator)
void setFieldSeparatorAtEnd (boolean fieldSeparatorAtEnd)
void setFieldSeparatorAtStart (boolean fieldSeparatorAtStart)
void setNullText (String nullText)
void setShortClassName (boolean shortClassName)
void setSizeEndText (String sizeEndText)
void setSizeStartText (String sizeStartText)
void setSummaryObjectEndText (String summaryObjectEndText)
void setSummaryObjectStartText (String summaryObjectStartText)
void setUseClassName (boolean useClassName)
void setUseFieldNames (boolean useFieldNames)
void setUseIdentityHashCode (boolean useIdentityHashCode)
void setUseShortClassName (boolean useShortClassName)
 ToStringStyle ()

Private Attributes

boolean arrayContentDetail = true
String arrayEnd = "}"
String arraySeparator = ","
String arrayStart = "{"
String contentEnd = "]"
String contentStart = "["
boolean defaultFullDetail = true
String fieldNameValueSeparator = "="
String fieldSeparator = ","
boolean fieldSeparatorAtEnd = false
boolean fieldSeparatorAtStart = false
String nullText = "<null>"
String sizeEndText = ">"
String sizeStartText = "<size="
String summaryObjectEndText = ">"
String summaryObjectStartText = "<"
boolean useClassName = true
boolean useFieldNames = true
boolean useIdentityHashCode = true
boolean useShortClassName = false

Classes

class  DefaultToStringStyle
class  MultiLineToStringStyle
class  NoFieldNameToStringStyle
class  SimpleToStringStyle

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index