Package org.apache.commons.lang3.builder
Class RecursiveToStringStyle
java.lang.Object
org.apache.commons.lang3.builder.ToStringStyle
org.apache.commons.lang3.builder.RecursiveToStringStyle
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- MultilineRecursiveToStringStyle
Works with 
ToStringBuilder to create a "deep" toString.
 To use this class write code as follows:
 public class Job {
   String title;
   ...
 }
 public class Person {
   String name;
   int age;
   boolean smoker;
   Job job;
   ...
   public String toString() {
     return new ReflectionToStringBuilder(this, new RecursiveToStringStyle()).toString();
   }
 }
 
 This will produce a toString of the format:
 Person@7f54[name=Stephen,age=29,smoker=false,job=Job@43cd2[title=Manager]]
- Since:
- 3.2
- See Also:
- 
Field SummaryFields inherited from class org.apache.commons.lang3.builder.ToStringStyleDEFAULT_STYLE, JSON_STYLE, MULTI_LINE_STYLE, NO_CLASS_NAME_STYLE, NO_FIELD_NAMES_STYLE, SHORT_PREFIX_STYLE, SIMPLE_STYLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanReturns whether or not to recursively format the givenClass.voidappendDetail(StringBuffer buffer, String fieldName, Object value) protected voidappendDetail(StringBuffer buffer, String fieldName, Collection<?> coll) Appends to thetoStringaCollection.Methods inherited from class org.apache.commons.lang3.builder.ToStringStyleappend, 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, appendDetail, appendDetail, appendDetail, appendEnd, appendFieldEnd, appendFieldSeparator, appendFieldStart, appendIdentityHashCode, appendInternal, appendNullText, appendStart, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummarySize, appendSuper, appendToString, getArrayEnd, getArraySeparator, getArrayStart, getContentEnd, getContentStart, getFieldNameValueSeparator, getFieldSeparator, getNullText, getRegistry, getShortClassName, getSizeEndText, getSizeStartText, getSummaryObjectEndText, getSummaryObjectStartText, isArrayContentDetail, isDefaultFullDetail, isFieldSeparatorAtEnd, isFieldSeparatorAtStart, isFullDetail, isUseClassName, isUseFieldNames, isUseIdentityHashCode, isUseShortClassName, reflectionAppendArrayDetail, removeLastFieldSeparator, setArrayContentDetail, setArrayEnd, setArraySeparator, setArrayStart, setContentEnd, setContentStart, setDefaultFullDetail, setFieldNameValueSeparator, setFieldSeparator, setFieldSeparatorAtEnd, setFieldSeparatorAtStart, setNullText, setSizeEndText, setSizeStartText, setSummaryObjectEndText, setSummaryObjectStartText, setUseClassName, setUseFieldNames, setUseIdentityHashCode, setUseShortClassName
- 
Constructor Details- 
RecursiveToStringStylepublic RecursiveToStringStyle()Constructs a new instance.
 
- 
- 
Method Details- 
acceptReturns whether or not to recursively format the givenClass. By default, this method always returnstrue, but may be overwritten by subclasses to filter specific classes.- Parameters:
- clazz- The class to test.
- Returns:
- Whether or not to recursively format the given Class.
 
- 
appendDetailDescription copied from class:ToStringStyleAppends to thetoStringaCollection.- Overrides:
- appendDetailin class- ToStringStyle
- Parameters:
- buffer- the- StringBufferto populate
- fieldName- the field name, typically not used as already appended
- coll- the- Collectionto add to the- toString, not- null
 
- 
appendDetailDescription copied from class:ToStringStyle- Overrides:
- appendDetailin class- ToStringStyle
- Parameters:
- buffer- the- StringBufferto populate
- fieldName- the field name, typically not used as already appended
- value- the value to add to the- toString, not- null
 
 
-