title: GSON - Exclude Object based on Value of Field
body: <p>I have some JSON, which contains a key named "type". This key can have the value <code>include</code> or <code>exclude</code>.  I want to configure Gson to not deserialize the Json, and create an object when the key value is <code>exclude</code>.</p>
  
  <p>I realize I can write a custom deserializer, check for the appropriate, and create the object or not.  However, I was not sure if there was another way using some type of exclusion strategy.   </p>
  
  <p>The example I outlined is over-simplified.  My real JSON contains many more fields.</p>
  
  <pre><code>// Deserialize me
  {     
     "type" : "include"
  }
  
  // Skip over me, and do not deserialize
  {
     "type" : "exclude"
  }
  </code></pre>