title: gson exclusion strategy apply only to fields of target object
body: <p>I want to prevent Gson from serializing fields of a specific type. For this, I have created an exclusion strategy. The exclusion strategy does successfully recognize when the class in question is being processed and it does successfully exclude it. Unfortunately, it prevents me from serializing objects of that class even when they are the root. By that I mean they are the argument passed to the gson.toJson() method.</p>
  
  <p>To be more clear, I have a class of type Person with class fields that themselves involve the Person type. I do not want to serialize class fields of the type Person.</p>
  
  <pre><code>public class Person{
     private Person child;
     private String name;
  }
  </code></pre>
  
  <p>So, in the above example, I want a json object containing the <code>name</code> field but not the <code>child</code> field. I want the solution to be sensitive the the type of the field, not the field name.</p>