Given a structure like this:
{
\"nameOfObject\": { \"score\": 100 },
\"anotherObject\": { \"score\": 30 }
}
Is it possible to map this
I am a firm believer in separating your POJOs from externalization. Read your JSON into a Map and then build you Container/ScoreKeeper objects like this (apols for any typos):
mapper = new ObjectMapper();
Map data = mapper.readValue(inputstream, Map.class);
Container c = new Container();
for(Map.Entry me : data.entrySet()) {
String key = me.getKey();
Map info = (Map) me.getValue();
ScoreKeeper sk = new ScoreKeeper();
sk.setName(key);
Integer q = info.get("score");
sk.setScore(q);
c.put(key, sk);
}