title: Read field from parent node in custom Jackson Deserializer
body: <p>Have a look at the following input JSON:</p>
  
  <pre><code>{
      "importantKey": "123xyz",
      "nested": {
          // more stuff goes here.
      }
  }
  </code></pre>
  
  <p><code>Nested</code> is represented by an interface that has several different implementations.
  The point is, in order to figure out which implementation should be used for deserialization, I need to check <code>importantKey's</code> value. </p>
  
  <p>My current solution is to deserialize the whole thing at once:</p>
  
  <pre><code>@Override
  public Foo deserialize(JsonParser jp, DeserializationContext dc) 
              throws IOException, JsonProcessingException {
  
      ObjectMapper objectMapper = (ObjectMapper) jp.getCodec();
      ObjectNode objectNode = objectMapper.readTree(jp);
      String importantKey = objectNode.findValue("importantKey").asText();
  
      JsonNode nestedNode = objectNode.findValue("nested");
      NestedInterface nested;
      nested = objectMapper.treeToValue(nestedNode, findNestedImplFor(importantKey));
  
      // construct containing Foo and so on ...
  }
  </code></pre>
  
  <p>This works but for several different reasons (specific to my use case) it would be a lot cooler if there was a Deserializer just for <code>nested</code> that somehow could read or had access to fields from the outer object.</p>
  
  <p>I'm running jackson 2.8.x in a dropwizard context.</p>
  
  <p>Does someone have an idea? Thanks in advance!</p>