net.sf.seaf.util
Class RecursiveReflectionToStringStyle

java.lang.Object
  extended by org.apache.commons.lang.builder.ToStringStyle
      extended by net.sf.seaf.util.RecursiveReflectionToStringStyle
All Implemented Interfaces:
Serializable

public class RecursiveReflectionToStringStyle
extends org.apache.commons.lang.builder.ToStringStyle

Converts Object to String recursively using ReflectionToStringBuilder .

Base type objects such as String, Number, Character or Boolean are passed to ToStringBuilder and directly converted to String, objects Date and Calendar are converted to String with a timestamp format YYYY-MM-DD'T'HH:MM:SS.sss.

Each object in Array, Collection or Map is recursively converted as well. In case of Map, keys are not handled recursively.

Unicode null character is treated. In case of String, it is removed. In case of Character, it is replaced by a null string.

Author:
pspicka
See Also:
Serialized Form

Field Summary
static RecursiveReflectionToStringStyle DEFAULT_RR_STYLE
          The default style.
static RecursiveReflectionToStringStyle SIMPLE_RR_STYLE
          Simplified style.
 
Fields inherited from class org.apache.commons.lang.builder.ToStringStyle
DEFAULT_STYLE, MULTI_LINE_STYLE, NO_FIELD_NAMES_STYLE, SHORT_PREFIX_STYLE, SIMPLE_STYLE
 
Method Summary
protected  void appendDetail(StringBuffer buffer, String fieldName, byte[] array)
           
protected  void appendDetail(StringBuffer buffer, String fieldName, Character value)
          Appender for Character.
protected  void appendDetail(StringBuffer buffer, String fieldName, Collection coll)
           
protected  void appendDetail(StringBuffer buffer, String fieldName, Map.Entry hashMapEntry)
          Appender for Map.Entry, key is appended directly, value is appended recursively.
protected  void appendDetail(StringBuffer buffer, String fieldName, Map map)
           
protected  void appendDetail(StringBuffer buffer, String fieldName, Object value)
           
protected  void appendDetail(StringBuffer buffer, String fieldName, String value)
          Appender for String, filters unicode null character and appends String to Buffer.
protected  void appendSummarySize(StringBuffer buffer, String fieldName, int size)
           
 
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, appendCyclicObject, 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, appendSuper, appendToString, getArrayEnd, getArraySeparator, getArrayStart, getContentEnd, getContentStart, getFieldNameValueSeparator, getFieldSeparator, getNullText, getShortClassName, getSizeEndText, getSizeStartText, getSummaryObjectEndText, getSummaryObjectStartText, isArrayContentDetail, isDefaultFullDetail, isFieldSeparatorAtEnd, isFieldSeparatorAtStart, isFullDetail, isShortClassName, isUseClassName, isUseFieldNames, isUseIdentityHashCode, isUseShortClassName, reflectionAppendArrayDetail, removeLastFieldSeparator, setArrayContentDetail, setArrayEnd, setArraySeparator, setArrayStart, setContentEnd, setContentStart, setDefaultFullDetail, setFieldNameValueSeparator, setFieldSeparator, setFieldSeparatorAtEnd, setFieldSeparatorAtStart, setNullText, setShortClassName, setSizeEndText, setSizeStartText, setSummaryObjectEndText, setSummaryObjectStartText, setUseClassName, setUseFieldNames, setUseIdentityHashCode, setUseShortClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RR_STYLE

public static final RecursiveReflectionToStringStyle DEFAULT_RR_STYLE
The default style.


SIMPLE_RR_STYLE

public static final RecursiveReflectionToStringStyle SIMPLE_RR_STYLE
Simplified style. Changes comprise: no ID hash code.

Method Detail

appendDetail

protected void appendDetail(StringBuffer buffer,
                            String fieldName,
                            byte[] array)
Overrides:
appendDetail in class org.apache.commons.lang.builder.ToStringStyle

appendSummarySize

protected void appendSummarySize(StringBuffer buffer,
                                 String fieldName,
                                 int size)
Overrides:
appendSummarySize in class org.apache.commons.lang.builder.ToStringStyle

appendDetail

protected void appendDetail(StringBuffer buffer,
                            String fieldName,
                            Map map)
Overrides:
appendDetail in class org.apache.commons.lang.builder.ToStringStyle

appendDetail

protected void appendDetail(StringBuffer buffer,
                            String fieldName,
                            Collection coll)
Overrides:
appendDetail in class org.apache.commons.lang.builder.ToStringStyle

appendDetail

protected void appendDetail(StringBuffer buffer,
                            String fieldName,
                            Object value)
Overrides:
appendDetail in class org.apache.commons.lang.builder.ToStringStyle

appendDetail

protected void appendDetail(StringBuffer buffer,
                            String fieldName,
                            String value)
Appender for String, filters unicode null character and appends String to Buffer.

Parameters:
buffer -
fieldName -
value -

appendDetail

protected void appendDetail(StringBuffer buffer,
                            String fieldName,
                            Character value)
Appender for Character. If it is unicode null value replaces it with null text, otherwise appends the value.

Parameters:
buffer -
fieldName -
value -

appendDetail

protected void appendDetail(StringBuffer buffer,
                            String fieldName,
                            Map.Entry hashMapEntry)
Appender for Map.Entry, key is appended directly, value is appended recursively.

Parameters:
buffer -
fieldName -
hashMapEntry -


Copyright © 2008-2012 SEAF. All Rights Reserved.