title: Jackson deserialize based on type
body: <p>Lets say I have JSON of the following format:</p>
  
  <pre><code>{
      "type" : "Foo"
      "data" : {
          "object" : {
              "id" : "1"
              "fizz" : "bizz"
              ...
          },
          "metadata" : {
              ...
          },
          "owner" : {
              "name" : "John"
              ...
          }
      }
  }
  </code></pre>
  
  <p>I am trying to avoid custom deserializer and attempting to deserialize the above JSON (called Wrapper.java) into Java POJOs. The "type" field dictates the "object" deserialization ie. type = foo means the deserialize the "object" field using the Foo.java. (if type = Bar, use Bar.java to deserialize the object field). Metadata/owner will always deserialize the same way using a simple Jackson annotated Java class for each. Is there a way to accomplish this using annotations? If not, how can this be done using a custom deserializer?</p>