List of usage examples for com.google.gwt.json.client JSONException JSONException
public JSONException()
From source file:com.eduworks.gwt.client.net.packet.AjaxPacket.java
License:Apache License
public void put(String key, Object jsonValue) { if (jsonValue instanceof String) super.put(key, new JSONString((String) jsonValue)); else if (jsonValue instanceof Number) super.put(key, new JSONNumber(Double.parseDouble(String.valueOf(jsonValue)))); else if (jsonValue instanceof JSONArray) super.put(key, (JSONArray) jsonValue); else if (jsonValue instanceof JSONObject) super.put(key, (JSONObject) jsonValue); else if (jsonValue instanceof Boolean) super.put(key, JSONBoolean.getInstance((Boolean) jsonValue)); else if (jsonValue == null) super.put(key, (JSONNull) jsonValue); else//from ww w. jav a 2 s .c o m throw new JSONException(); }