title: How to ignore JSON properties similar to @JsonIgnore in Deserialization
body: <p>I have a JSON object similar below:</p>
  <pre><code>[
    {
       &quot;objA&quot;: {
         &quot;propA&quot;: &quot;AAAA&quot;,
         &quot;propB&quot;: &quot;BBBB&quot;,
         &quot;objB&quot;: {
           &quot;objC&quot;: {
             &quot;propC&quot;: &quot;CCCC&quot;,
             &quot;propD&quot;: &quot;DDDD&quot;
           }
         },
         &quot;objD&quot;: [
           &quot;asa&quot;
         ],
         &quot;propE&quot;: &quot;AW&quot;,
         &quot;propF&quot;: &quot;533&quot;,
         &quot;propG&quot;: &quot;ABW&quot;,
         &quot;propH&quot;: &quot;ARU&quot;,
         &quot;objE&quot;: {
           &quot;objF&quot;: {
             &quot;propI&quot;: &quot;SASDS&quot;,
             &quot;propJ&quot;: &quot;54DEFF&quot;
           }
         }
       }
     }
  ]
  </code></pre>
  <p>When I deserialize this JSON into a List, I would like to do for part of this object, for example: I would like to ignore objB, objC, objD, objE and objF.
  To do that I has been used the @JsonIgnore annotation. So I did something like that:</p>
  <pre><code>public class MyClass {
  
  // objects and properties not ignorabled
  private ClassA objA;
  private String propE;
  private String propF;
  private String propG;;
  private String propH;
  
  // objects ignorabled in deserialization 
  @JsonProperty(&quot;objB&quot;)
  @JsonIgnore
  private Object objB;
  
  @JsonProperty(&quot;objD&quot;)
  @JsonIgnore
  private Object objD;
  
  @JsonProperty(&quot;objE&quot;)
  @JsonIgnore
  private Object objE;
  
  /** gets and setters here **/
  </code></pre>
  <p>Follow below the piece of code that deserialize my JSON</p>
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  return mapper.readValue(url, new TypeReference&lt;List&lt;MyClass&gt;&gt;(){});
  </code></pre>
  <p>This code is working. this code is ignoring the objects from JSON, but I believe there are some another way to do that instead of use @JsonIgnore to each object or property in my entity.</p>
  <p>Do you know how can I do that better?</p>