title: Jackson Json Type Mapping Inner Class
body: <p>I am trying to create the inner class type for an object being passed in as JSON but while I have read tons on here as well as Jackson's site I don't seem to be able to get the right combination so if anyone else has any pointers they would be much appreciated. I've posted some snippets below and removed all getters and setters, I didn't figure they needed posting. I'm using Jackson 2.2.</p>
  
  <p>The classes I'm attempting to deserialize:</p>
  
  <pre><code>public class Settings {
    private int offset;
    private int limit;
    private String type;
    private Map&lt;String, Criteria&gt; criteria;
  
    public class Criteria {
      private String restriction;
      private Object value;
    }
  }
  </code></pre>
  
  <p>The code I'm using to deserialize:</p>
  
  <pre><code>ObjectMapper om = new ObjectMapper();
  TypeFactory tf = om.getTypeFactory();
  JavaType map = tf.constructMapLikeType( Map.class, String.class, Criteria.class );
  JavaType type = typeFactory.constructType( Settings.class, map );
  Settings settings = om.readValue( entity, type );
  </code></pre>
  
  <p>My JSON testing data:</p>
  
  <pre><code>{ "type": "org.json.Car", "criteria": { "restriction": "eq", "value": "bmw" } }
  </code></pre>