Class MultilineRecursiveToStringStyle

All Implemented Interfaces:
Serializable

Works with ToStringBuilder to create a "deep" toString. But instead a single line like the RecursiveToStringStyle this creates a multiline String similar to the ToStringStyle.MULTI_LINE_STYLE.

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 MultilineRecursiveToStringStyle()).toString();
   }
 }
 

This will produce a toString of the format:
Person@7f54[ <br> &nbsp; name=Stephen, <br> &nbsp; age=29, <br> &nbsp; smokealse, <br> &nbsp; job=Job@43cd2[ <br> &nbsp; &nbsp; title=Manager <br> &nbsp; ] <br> ]

Since:
3.4
See Also: