public Object unmarshall(SerializerState state, Class clazz, Object o) throws UnmarshallException {
JSONObject jso = (JSONObject) o;
String java_class = jso.getString("javaClass");
if (java_class == null)
throw new UnmarshallException("no type hint");
AbstractSet abset = null;
if (java_class.equals("java.util.Set") || java_class.equals("java.util.AbstractSet")
|| java_class.equals("java.util.HashSet")) {
abset = new HashSet();
} else if (java_class.equals("java.util.TreeSet")) {
abset = new TreeSet();
} else if (java_class.equals("java.util.LinkedHashSet")) {
abset = new LinkedHashSet();
} else {
throw new UnmarshallException("not a Set");
}
JSONObject jsonset = jso.getJSONObject("set");
if (jsonset == null)
throw new UnmarshallException("set missing");
Iterator i = jsonset.keys();
String key = null;
try {
while (i.hasNext()) {
key = (String) i.next();
Object setElement = jsonset.get(key);
abset.add(ser.unmarshall(state, null, setElement));
}
} catch (UnmarshallException e) {
throw new UnmarshallException("key " + i + e.getMessage());
}
return abset;