title: Mapping Json string to map or hashmap field in java
body: <p>Say I have the following JSON string returned from server: </p>
  
  <pre><code>{
      "response":{
          "imageInstances":{
              "one":{
                  "id":"1",
                  "url":"ONE"
              },         
              "two":{
                  "id":"2",
                  "url":"TWO"
              }
          }
      }  
  }
  </code></pre>
  
  <p>in codehaus Jackson <code>@JsonProperty</code>, how can I get a <code>HashMap</code> object out of it?</p>
  
  <pre><code>import org.codehaus.jackson.annotate.JsonAnySetter;
  import org.codehaus.jackson.annotate.JsonProperty;
  
  import java.util.HashMap;
  import java.util.List;
  
  public class MSShow {
    @JsonProperty("imageInstances") private HashMap&lt;String, Temp&gt; images;//// HOW DO YOU CONVERT IT TO HASH MAP??????
    @JsonAnySetter public void ignoredField(String key, Object value) { }
  
    private class Temp {
      @JsonProperty("id") private String id;
      @JsonProperty("url") private String url;
      @JsonAnySetter public void ignoredField(String key, Object value) { }
      }
  }
  </code></pre>
  
  <p>At the end of the day, I want the hash map generated based on the returned JSON string to be
  (written in java pseudo)</p>
  
  <p>should return me a Temp object with fields <code>id=1</code> and <code>url=ONE</code> if I call</p>
  
  <pre><code>images.get("one")
  </code></pre>
  
  <p>should return me a Temp object with fields <code>id=2</code> and <code>url=TWO</code> if I call</p>
  
  <pre><code>images.get("two") 
  </code></pre>