List of usage examples for org.json JSONObject getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:run.ace.Utils.java
public static Object deserializeObjectOrStruct(JSONObject obj) { try {// ww w. j a v a 2 s . com String type = obj.getString("_t"); if (type.equals("H")) { return Handle.deserialize(obj); } else if (type.equals("Thickness")) { return Thickness.deserialize(obj); } else if (type.equals("GridLength")) { return GridLength.deserialize(obj); } else { throw new RuntimeException("Unhandled struct type: " + obj.getClass()); } } catch (JSONException ex) { throw new RuntimeException(ex); } }