title: How to map a parent attribute to a child object when deserializing JSON into Java objects?
body: <p>Given JSON like this:</p>
  
  <pre><code>{
      "locale" : "US",
      "children" : [
              {
                  "foo" : "bar"
              },
              {
                  "foo" : "baz"
              }
          ]
  }
  </code></pre>
  
  <p>being mapped to Java objects like this:</p>
  
  <pre><code>public class Parent {
      @JsonProperty public String getLocale() {...}
      @JsonProperty public List&lt;Child&gt; getChildren() {...}
  }
  
  public class Child {
      public void setLocale(String locale) {...}
      @JsonProperty public String getFoo() {...}
  }
  </code></pre>
  
  <p>How can I populate the locale property of Child instances with the value that is in the JSON at the top (<code>Parent</code>) level?</p>
  
  <p>I thought I might be able to use <code>@JsonDeserialize(using=MyDeserializer.class)</code> on the <code>setLocale()</code> method of <code>Child</code> to use a custom serializer, but that's not working (I suspect because there is no value in the JSON at the Child level so Jackson doesn't know about any values that are supposed to be deserialized into the <code>locale</code> property).</p>
  
  <p>I'd like to avoid having to write an entire custom deserializer for the entire <code>Child</code> class, which in reality has lots more data to be mapped.</p>