| java.lang.Object org.apache.commons.lang.builder.ToStringStyle
All known Subclasses: org.apache.commons.lang.builder.StandardToStringStyle,
ToStringStyle | abstract public class ToStringStyle implements Serializable(Code) | | 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.
If you want to format the output of certain objects, such as dates, you
must create a subclass and override a method.
public class MyStyle extends ToStringStyle {
protected void appendDetail(StringBuffer buffer, String fieldName, Object value) {
if (value instanceof Date) {
value = new SimpleDateFormat("yyyy-MM-dd").format(value);
}
buffer.append(value);
}
}
author: Stephen Colebourne author: Gary Gregory author: Pete Gieser author: Masato Tezuka since: 1.0 version: $Id: ToStringStyle.java 500497 2007-01-27 07:13:59Z bayard $ |
Method Summary | |
public void | append(StringBuffer buffer, String fieldName, Object value, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, long value) | public void | append(StringBuffer buffer, String fieldName, int value) | public void | append(StringBuffer buffer, String fieldName, short value) | public void | append(StringBuffer buffer, String fieldName, byte value) | public void | append(StringBuffer buffer, String fieldName, char value) | public void | append(StringBuffer buffer, String fieldName, double value) | public void | append(StringBuffer buffer, String fieldName, float value) | public void | append(StringBuffer buffer, String fieldName, boolean value) | public void | append(StringBuffer buffer, String fieldName, Object[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, long[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, int[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, short[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, byte[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, char[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, double[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, float[] array, Boolean fullDetail) | public void | append(StringBuffer buffer, String fieldName, boolean[] array, Boolean fullDetail) | protected void | appendClassName(StringBuffer buffer, Object object) | protected void | appendContentEnd(StringBuffer buffer) | protected void | appendContentStart(StringBuffer buffer) | protected void | appendCyclicObject(StringBuffer buffer, String fieldName, Object value) Append to the toString an Object
value that has been detected to participate in a cycle. | protected void | appendDetail(StringBuffer buffer, String fieldName, Object value) | protected void | appendDetail(StringBuffer buffer, String fieldName, Collection coll) | protected void | appendDetail(StringBuffer buffer, String fieldName, Map map) | protected void | appendDetail(StringBuffer buffer, String fieldName, long value) | protected void | appendDetail(StringBuffer buffer, String fieldName, int value) | protected void | appendDetail(StringBuffer buffer, String fieldName, short value) | protected void | appendDetail(StringBuffer buffer, String fieldName, byte value) | protected void | appendDetail(StringBuffer buffer, String fieldName, char value) | protected void | appendDetail(StringBuffer buffer, String fieldName, double value) | protected void | appendDetail(StringBuffer buffer, String fieldName, float value) | protected void | appendDetail(StringBuffer buffer, String fieldName, boolean value) | protected void | appendDetail(StringBuffer buffer, String fieldName, Object[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, long[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, int[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, short[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, byte[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, char[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, double[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, float[] array) | protected void | appendDetail(StringBuffer buffer, String fieldName, boolean[] array) | public void | appendEnd(StringBuffer buffer, Object object) | protected void | appendFieldEnd(StringBuffer buffer, String fieldName) | protected void | appendFieldSeparator(StringBuffer buffer) | protected void | appendFieldStart(StringBuffer buffer, String fieldName) | protected void | appendIdentityHashCode(StringBuffer buffer, Object object) | protected void | appendInternal(StringBuffer buffer, String fieldName, Object value, boolean detail) | protected void | appendNullText(StringBuffer buffer, String fieldName) | public void | appendStart(StringBuffer buffer, Object object) | protected void | appendSummary(StringBuffer buffer, String fieldName, Object value) | protected void | appendSummary(StringBuffer buffer, String fieldName, Object[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, long[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, int[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, short[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, byte[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, char[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, double[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, float[] array) | protected void | appendSummary(StringBuffer buffer, String fieldName, boolean[] array) | protected void | appendSummarySize(StringBuffer buffer, String fieldName, int size) | public void | appendSuper(StringBuffer buffer, String superToString) | public void | appendToString(StringBuffer buffer, String toString) | protected String | getArrayEnd() | protected String | getArraySeparator() | protected String | getArrayStart() | protected String | getContentEnd() | protected String | getContentStart() | protected String | getFieldNameValueSeparator() | protected String | getFieldSeparator() | protected String | getNullText() | static Set | getRegistry()
Returns the registry of objects being traversed by the reflectionToString
methods in the current thread. | protected String | getShortClassName(Class cls) | protected String | getSizeEndText() | protected String | getSizeStartText() | protected String | getSummaryObjectEndText() | protected String | getSummaryObjectStartText() | protected boolean | isArrayContentDetail() | protected boolean | isDefaultFullDetail() | protected boolean | isFieldSeparatorAtEnd() | protected boolean | isFieldSeparatorAtStart() | protected boolean | isFullDetail(Boolean fullDetailRequest) Is this field to be output in full detail.
This method converts a detail request into a detail level.
The calling code may request full detail (true ),
but a subclass might ignore that and always return
false . | static boolean | isRegistered(Object value)
Returns true if the registry contains the given object.
Used by the reflection methods to avoid infinite loops.
Parameters: value - The object to lookup in the registry. | protected boolean | isShortClassName() | protected boolean | isUseClassName() | protected boolean | isUseFieldNames() | protected boolean | isUseIdentityHashCode() | protected boolean | isUseShortClassName() | protected void | reflectionAppendArrayDetail(StringBuffer buffer, String fieldName, Object array) | static void | register(Object value)
Registers the given object. | protected void | removeLastFieldSeparator(StringBuffer buffer) | protected void | setArrayContentDetail(boolean arrayContentDetail) | protected void | setArrayEnd(String arrayEnd) | protected void | setArraySeparator(String arraySeparator) | protected void | setArrayStart(String arrayStart) | protected void | setContentEnd(String contentEnd) | protected void | setContentStart(String contentStart) | protected void | setDefaultFullDetail(boolean defaultFullDetail) | protected void | setFieldNameValueSeparator(String fieldNameValueSeparator) | protected void | setFieldSeparator(String fieldSeparator) | protected void | setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd) | protected void | setFieldSeparatorAtStart(boolean fieldSeparatorAtStart) | protected void | setNullText(String nullText) | protected void | setShortClassName(boolean shortClassName) | protected void | setSizeEndText(String sizeEndText) | protected void | setSizeStartText(String sizeStartText) | protected void | setSummaryObjectEndText(String summaryObjectEndText) | protected void | setSummaryObjectStartText(String summaryObjectStartText) | protected void | setUseClassName(boolean useClassName) | protected void | setUseFieldNames(boolean useFieldNames) | protected void | setUseIdentityHashCode(boolean useIdentityHashCode) | protected void | setUseShortClassName(boolean useShortClassName) | static void | unregister(Object value)
Unregisters the given object. |
MULTI_LINE_STYLE | final public static ToStringStyle MULTI_LINE_STYLE(Code) | | The multi line toString style.
|
NO_FIELD_NAMES_STYLE | final public static ToStringStyle NO_FIELD_NAMES_STYLE(Code) | | The no field names toString style.
|
SHORT_PREFIX_STYLE | final public static ToStringStyle SHORT_PREFIX_STYLE(Code) | | The short prefix toString style.
since: 2.1 |
ToStringStyle | protected ToStringStyle()(Code) | | Constructor.
|
append | public void append(StringBuffer buffer, String fieldName, Object value, Boolean fullDetail)(Code) | | Append to the toString an Object
value, printing the full toString of the
Object passed in.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, long value)(Code) | | Append to the toString a long
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, int value)(Code) | | Append to the toString an int
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, short value)(Code) | | Append to the toString a short
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, byte value)(Code) | | Append to the toString a byte
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, char value)(Code) | | Append to the toString a char
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, double value)(Code) | | Append to the toString a double
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, float value)(Code) | | Append to the toString a float
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, boolean value)(Code) | | Append to the toString a boolean
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: value - the value to add to the toString |
append | public void append(StringBuffer buffer, String fieldName, Object[] array, Boolean fullDetail)(Code) | | Append to the toString an Object
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, long[] array, Boolean fullDetail)(Code) | | Append to the toString a long
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, int[] array, Boolean fullDetail)(Code) | | Append to the toString an int
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, short[] array, Boolean fullDetail)(Code) | | Append to the toString a short
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, byte[] array, Boolean fullDetail)(Code) | | Append to the toString a byte
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, char[] array, Boolean fullDetail)(Code) | | Append to the toString a char
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, double[] array, Boolean fullDetail)(Code) | | Append to the toString a double
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, float[] array, Boolean fullDetail)(Code) | | Append to the toString a float
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
append | public void append(StringBuffer buffer, String fieldName, boolean[] array, Boolean fullDetail)(Code) | | Append to the toString a boolean
array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name Parameters: array - the array to add to the toString Parameters: fullDetail - true for detail, false for summary info, null for style decides |
appendClassName | protected void appendClassName(StringBuffer buffer, Object object)(Code) | | Append to the toString the class name.
Parameters: buffer - the StringBuffer to populate Parameters: object - the Object whose name to output |
appendContentEnd | protected void appendContentEnd(StringBuffer buffer)(Code) | | Append to the toString the content end.
Parameters: buffer - the StringBuffer to populate |
appendContentStart | protected void appendContentStart(StringBuffer buffer)(Code) | | Append to the toString the content start.
Parameters: buffer - the StringBuffer to populate |
appendCyclicObject | protected void appendCyclicObject(StringBuffer buffer, String fieldName, Object value)(Code) | | Append to the toString an Object
value that has been detected to participate in a cycle. This
implementation will print the standard string value of the value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString ,not null since: 2.2 |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, Object value)(Code) | | Append to the toString an Object
value, printing the full detail of the Object .
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, Collection coll)(Code) | | Append to the toString a Collection .
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: coll - the Collection to add to thetoString , not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, Map map)(Code) | | Append to the toString a Map.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: map - the Map to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, long value)(Code) | | Append to the toString a long
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, int value)(Code) | | Append to the toString an int
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, short value)(Code) | | Append to the toString a short
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, byte value)(Code) | | Append to the toString a byte
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, char value)(Code) | | Append to the toString a char
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, double value)(Code) | | Append to the toString a double
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, float value)(Code) | | Append to the toString a float
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, boolean value)(Code) | | Append to the toString a boolean
value.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, Object[] array)(Code) | | Append to the toString the detail of an
Object array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, long[] array)(Code) | | Append to the toString the detail of a
long array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, int[] array)(Code) | | Append to the toString the detail of an
int array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, short[] array)(Code) | | Append to the toString the detail of a
short array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, byte[] array)(Code) | | Append to the toString the detail of a
byte array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, char[] array)(Code) | | Append to the toString the detail of a
char array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, double[] array)(Code) | | Append to the toString the detail of a
double array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, float[] array)(Code) | | Append to the toString the detail of a
float array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendDetail | protected void appendDetail(StringBuffer buffer, String fieldName, boolean[] array)(Code) | | Append to the toString the detail of a
boolean array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendEnd | public void appendEnd(StringBuffer buffer, Object object)(Code) | | Append to the toString the end of data indicator.
Parameters: buffer - the StringBuffer to populate Parameters: object - the Object to build atoString for. |
appendFieldEnd | protected void appendFieldEnd(StringBuffer buffer, String fieldName)(Code) | | Append to the toString the field end.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended |
appendFieldSeparator | protected void appendFieldSeparator(StringBuffer buffer)(Code) | | Append to the toString the field separator.
Parameters: buffer - the StringBuffer to populate |
appendFieldStart | protected void appendFieldStart(StringBuffer buffer, String fieldName)(Code) | | Append to the toString the field start.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name |
appendInternal | protected void appendInternal(StringBuffer buffer, String fieldName, Object value, boolean detail)(Code) | | Append to the toString an Object ,
correctly interpreting its type.
This method performs the main lookup by Class type to correctly
route arrays, Collections , Maps and
Objects to the appropriate method.
Either detail or summary views can be specified.
If a cycle is detected, an object will be appended with the
Object.toString() format.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString ,not null Parameters: detail - output detail or not |
appendNullText | protected void appendNullText(StringBuffer buffer, String fieldName)(Code) | | Append to the toString an indicator for null .
The default indicator is '<null>' .
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended |
appendStart | public void appendStart(StringBuffer buffer, Object object)(Code) | | Append to the toString the start of data indicator.
Parameters: buffer - the StringBuffer to populate Parameters: object - the Object to build a toString for |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, Object value)(Code) | | Append to the toString an Object
value, printing a summary of the Object .
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: value - the value to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, Object[] array)(Code) | | Append to the toString a summary of an
Object array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, long[] array)(Code) | | Append to the toString a summary of a
long array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, int[] array)(Code) | | Append to the toString a summary of an
int array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, short[] array)(Code) | | Append to the toString a summary of a
short array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, byte[] array)(Code) | | Append to the toString a summary of a
byte array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, char[] array)(Code) | | Append to the toString a summary of a
char array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, double[] array)(Code) | | Append to the toString a summary of a
double array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, float[] array)(Code) | | Append to the toString a summary of a
float array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummary | protected void appendSummary(StringBuffer buffer, String fieldName, boolean[] array)(Code) | | Append to the toString a summary of a
boolean array.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null |
appendSummarySize | protected void appendSummarySize(StringBuffer buffer, String fieldName, int size)(Code) | | Append to the toString a size summary.
The size summary is used to summarize the contents of
Collections , Maps and arrays.
The output consists of a prefix, the passed in size
and a suffix.
The default format is '<size=n>'.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: size - the size to append |
appendSuper | public void appendSuper(StringBuffer buffer, String superToString)(Code) | | Append to the toString the superclass toString.
A null superToString is ignored.
Parameters: buffer - the StringBuffer to populate Parameters: superToString - the super.toString() since: 2.0 |
appendToString | public void appendToString(StringBuffer buffer, String toString)(Code) | | Append to the toString another toString.
A null toString is ignored.
Parameters: buffer - the StringBuffer to populate Parameters: toString - the additional toString since: 2.0 |
getArrayEnd | protected String getArrayEnd()(Code) | | Gets the array end text.
the current array end text |
getArraySeparator | protected String getArraySeparator()(Code) | | Gets the array separator text.
the current array separator text |
getArrayStart | protected String getArrayStart()(Code) | | Gets the array start text.
the current array start text |
getContentEnd | protected String getContentEnd()(Code) | | Gets the content end text.
the current content end text |
getContentStart | protected String getContentStart()(Code) | | Gets the content start text.
the current content start text |
getFieldNameValueSeparator | protected String getFieldNameValueSeparator()(Code) | | Gets the field name value separator text.
the current field name value separator text |
getFieldSeparator | protected String getFieldSeparator()(Code) | | Gets the field separator text.
the current field separator text |
getNullText | protected String getNullText()(Code) | | Gets the text to output when null found.
the current text to output when null found |
getRegistry | static Set getRegistry()(Code) | |
Returns the registry of objects being traversed by the reflectionToString
methods in the current thread.
Set the registry of objects being traversed |
getShortClassName | protected String getShortClassName(Class cls)(Code) | | Gets the short class name for a class.
The short class name is the classname excluding
the package name.
Parameters: cls - the Class to get the short name of the short name |
getSizeEndText | protected String getSizeEndText()(Code) | | Gets the end text to output when a Collection ,
Map or array size is output.
This is output after the size value.
the current end of size text |
getSizeStartText | protected String getSizeStartText()(Code) | | Gets the start text to output when a Collection ,
Map or array size is output.
This is output before the size value.
the current start of size text |
getSummaryObjectEndText | protected String getSummaryObjectEndText()(Code) | | Gets the end text to output when an Object is
output in summary mode.
This is output after the size value.
the current end of summary text |
getSummaryObjectStartText | protected String getSummaryObjectStartText()(Code) | | Gets the start text to output when an Object is
output in summary mode.
This is output before the size value.
the current start of summary text |
isArrayContentDetail | protected boolean isArrayContentDetail()(Code) | | Gets whether to output array content detail.
the current array content detail setting |
isDefaultFullDetail | protected boolean isDefaultFullDetail()(Code) | | Gets whether to use full detail when the caller doesn't
specify.
the current defaultFullDetail flag |
isFieldSeparatorAtEnd | protected boolean isFieldSeparatorAtEnd()(Code) | | Gets whether the field separator should be added at the end
of each buffer.
fieldSeparatorAtEnd flag since: 2.0 |
isFieldSeparatorAtStart | protected boolean isFieldSeparatorAtStart()(Code) | | Gets whether the field separator should be added at the start
of each buffer.
the fieldSeparatorAtStart flag since: 2.0 |
isFullDetail | protected boolean isFullDetail(Boolean fullDetailRequest)(Code) | | Is this field to be output in full detail.
This method converts a detail request into a detail level.
The calling code may request full detail (true ),
but a subclass might ignore that and always return
false . The calling code may pass in
null indicating that it doesn't care about
the detail level. In this case the default detail level is
used.
Parameters: fullDetailRequest - the detail level requested whether full detail is to be shown |
isRegistered | static boolean isRegistered(Object value)(Code) | |
Returns true if the registry contains the given object.
Used by the reflection methods to avoid infinite loops.
Parameters: value - The object to lookup in the registry. boolean true if the registry contains the givenobject. |
isUseClassName | protected boolean isUseClassName()(Code) | | Gets whether to use the class name.
the current useClassName flag |
isUseFieldNames | protected boolean isUseFieldNames()(Code) | | Gets whether to use the field names passed in.
the current useFieldNames flag |
isUseIdentityHashCode | protected boolean isUseIdentityHashCode()(Code) | | Gets whether to use the identity hash code.
the current useIdentityHashCode flag |
isUseShortClassName | protected boolean isUseShortClassName()(Code) | | Gets whether to output short or long class names.
the current useShortClassName flag since: 2.0 |
reflectionAppendArrayDetail | protected void reflectionAppendArrayDetail(StringBuffer buffer, String fieldName, Object array)(Code) | | Append to the toString the detail of an array type.
Parameters: buffer - the StringBuffer to populate Parameters: fieldName - the field name, typically not used as already appended Parameters: array - the array to add to the toString ,not null since: 2.0 |
register | static void register(Object value)(Code) | |
Registers the given object. Used by the reflection methods to avoid
infinite loops.
Parameters: value - The object to register. |
removeLastFieldSeparator | protected void removeLastFieldSeparator(StringBuffer buffer)(Code) | | Remove the last field separator from the buffer.
Parameters: buffer - the StringBuffer to populate since: 2.0 |
setArrayContentDetail | protected void setArrayContentDetail(boolean arrayContentDetail)(Code) | | Sets whether to output array content detail.
Parameters: arrayContentDetail - the new arrayContentDetail flag |
setArrayEnd | protected void setArrayEnd(String arrayEnd)(Code) | | Sets the array end text.
null is accepted, but will be converted to
an empty String.
Parameters: arrayEnd - the new array end text |
setArraySeparator | protected void setArraySeparator(String arraySeparator)(Code) | | Sets the array separator text.
null is accepted, but will be converted to
an empty String.
Parameters: arraySeparator - the new array separator text |
setArrayStart | protected void setArrayStart(String arrayStart)(Code) | | Sets the array start text.
null is accepted, but will be converted to
an empty String.
Parameters: arrayStart - the new array start text |
setContentEnd | protected void setContentEnd(String contentEnd)(Code) | | Sets the content end text.
null is accepted, but will be converted to
an empty String.
Parameters: contentEnd - the new content end text |
setContentStart | protected void setContentStart(String contentStart)(Code) | | Sets the content start text.
null is accepted, but will be converted to
an empty String.
Parameters: contentStart - the new content start text |
setDefaultFullDetail | protected void setDefaultFullDetail(boolean defaultFullDetail)(Code) | | Sets whether to use full detail when the caller doesn't
specify.
Parameters: defaultFullDetail - the new defaultFullDetail flag |
setFieldNameValueSeparator | protected void setFieldNameValueSeparator(String fieldNameValueSeparator)(Code) | | 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 |
setFieldSeparator | protected void setFieldSeparator(String fieldSeparator)(Code) | | Sets the field separator text.
null is accepted, but will be converted to
an empty String.
Parameters: fieldSeparator - the new field separator text |
setFieldSeparatorAtEnd | protected void setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd)(Code) | | Sets whether the field separator should be added at the end
of each buffer.
Parameters: fieldSeparatorAtEnd - the fieldSeparatorAtEnd flag since: 2.0 |
setFieldSeparatorAtStart | protected void setFieldSeparatorAtStart(boolean fieldSeparatorAtStart)(Code) | | Sets whether the field separator should be added at the start
of each buffer.
Parameters: fieldSeparatorAtStart - the fieldSeparatorAtStart flag since: 2.0 |
setNullText | protected void setNullText(String nullText)(Code) | | 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 |
setSizeEndText | protected void setSizeEndText(String sizeEndText)(Code) | | 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 |
setSizeStartText | protected void setSizeStartText(String sizeStartText)(Code) | | 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 |
setSummaryObjectEndText | protected void setSummaryObjectEndText(String summaryObjectEndText)(Code) | | 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 |
setSummaryObjectStartText | protected void setSummaryObjectStartText(String summaryObjectStartText)(Code) | | 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 |
setUseClassName | protected void setUseClassName(boolean useClassName)(Code) | | Sets whether to use the class name.
Parameters: useClassName - the new useClassName flag |
setUseFieldNames | protected void setUseFieldNames(boolean useFieldNames)(Code) | | Sets whether to use the field names passed in.
Parameters: useFieldNames - the new useFieldNames flag |
setUseIdentityHashCode | protected void setUseIdentityHashCode(boolean useIdentityHashCode)(Code) | | Sets whether to use the identity hash code.
Parameters: useIdentityHashCode - the new useIdentityHashCode flag |
setUseShortClassName | protected void setUseShortClassName(boolean useShortClassName)(Code) | | Sets whether to output short or long class names.
Parameters: useShortClassName - the new useShortClassName flag since: 2.0 |
unregister | static void unregister(Object value)(Code) | |
Unregisters the given object.
Used by the reflection methods to avoid infinite loops.
Parameters: value - The object to unregister. |
|
|