title: How have RecursiveToStringStyle and JSON_STYLE using commons-lang3
body: <p>I'm using the dependency:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.4&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I have the following objects:</p>
  
  <pre><code>public Class X {
  
    private String a;
    private String b;
    private Y y;
  }
  
  public Class Y {
    private String c;
    private String d;
  }
  </code></pre>
  
  <p>And I need to log the content of the class X recursively to get the class Y as well and using the JSON style. That is my goal and this is the purpose of this question.</p>
  
  <p>Approach 1:</p>
  
  <pre><code>ToStringStyle style = ToStringStyle.JSON_STYLE;
  LOGGER.debug(ReflectionToStringBuilder.toString(new X(), style, false, false));
  </code></pre>
  
  <p>Approach 1 result:</p>
  
  <pre><code>{"a":"&lt;a&gt;","b":"&lt;b&gt;","y": com.&lt;packages&gt;.y@&lt;hash&gt;}
  </code></pre>
  
  <p>Approach 2:</p>
  
  <pre><code>RecursiveToStringStyle style = new RecursiveToStringStyle();
  LOGGER.debug(ReflectionToStringBuilder.toString(new X(), style, false, false));
  </code></pre>
  
  <p>Approach 2 result:</p>
  
  <pre><code>[com.&lt;packages&gt;.x@&lt;hash&gt;[a=&lt;a&gt;,b=&lt;b&gt;,y=com.&lt;packages&gt;.y@&lt;hash&gt;[c=&lt;c&gt;,d=&lt;d&gt;]]
  </code></pre>
  
  <p>Successful Approach:</p>
  
  <pre><code>`Merge of Approach 1 and Approach 2` but how to achieve this? 
  </code></pre>
  
  <p>Successful Approach result (My goal):</p>
  
  <pre><code>{"a":"&lt;a&gt;","b":"&lt;b&gt;","y":{"c":"&lt;c&gt;","d":"&lt;d&gt;"}}
  </code></pre>