Десериализация в HashMap пользовательских объектов с Джексоном

У меня есть следующий класс:

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;

import java.io.Serializable;
import java.util.HashMap;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Theme implements Serializable {

    @JsonProperty
    private String themeName;

    @JsonProperty
    private boolean customized;

    @JsonProperty
    private HashMap descriptor;

    //...getters and setters for the above properties
}

Когда я выполняю следующий код:

    HashMap test = new HashMap();
    Theme t1 = new Theme();
    t1.setCustomized(false);
    t1.setThemeName("theme1");
    test.put("theme1", t1);

    Theme t2 = new Theme();
    t2.setCustomized(true);
    t2.setThemeName("theme2");
    t2.setDescriptor(new HashMap());
    t2.getDescriptor().put("foo", "one");
    t2.getDescriptor().put("bar", "two");
    test.put("theme2", t2);
    String json = "";
    ObjectMapper mapper = objectMapperFactory.createObjectMapper();
    try {
        json = mapper.writeValueAsString(test);
    } catch (IOException e) {
        e.printStackTrace(); 
    }

Полученная строка json выглядит следующим образом:

{
  "theme2": {
    "themeName": "theme2",
    "customized": true,
    "descriptor": {
      "foo": "one",
       "bar": "two"
    }
  },
  "theme1": {
    "themeName": "theme1",
    "customized": false,
    "descriptor": null
  }
}

Моя проблема состоит в том, чтобы получить приведенную выше строку json, чтобы де-серизлизировать обратно в

HashMap 

объект.

Мой код десериализации выглядит так:

HashMap themes =
        objectMapperFactory.createObjectMapper().readValue(json, HashMap.class);

Который десериализуется в HashMap с правильными ключами, но не создает объекты Theme для значений. Я нене знаю, что указать вместо "HashMap.class» в методе readValue ().

Любая помощь будет оценена.

Ответы на вопрос(3)

Ваш ответ на вопрос