throw new UnmarshallException("Could not read javaClass", e);
}
if (java_class == null) {
throw new UnmarshallException("no type hint");
}
AbstractMap abmap;
if (java_class.equals("java.util.Map") || java_class.equals("java.util.AbstractMap") || java_class.equals("java.util.HashMap")) {
abmap = new HashMap();
} else if (java_class.equals("java.util.TreeMap")) {
abmap = new TreeMap();
} else if (java_class.equals("java.util.LinkedHashMap")) {
abmap = new LinkedHashMap();
} else {
throw new UnmarshallException("'" + java_class + "' is not a Map");
}
JSONObject jsonmap;
try {
jsonmap = jso.getJSONObject("map");
} catch (JSONException e) {
throw new UnmarshallException("Could not read map: " + e.getMessage(), e);
}
if (jsonmap == null) {
throw new UnmarshallException("map missing");
}
state.setSerialized(o, abmap);
Iterator i = jsonmap.keys();
String key = null;
try {
while (i.hasNext()) {
key = (String) i.next();
abmap.put(key, _ser.unmarshall(state, null, jsonmap.get(key)));
}
} catch (UnmarshallException e) {
throw new UnmarshallException("key " + key + " " + e.getMessage(), e);
} catch (JSONException e) {
throw new UnmarshallException("key " + key + " " + e.getMessage(), e);