List of usage examples for com.google.gwt.json.client JSONNumber isNumber
@Override
public JSONNumber isNumber()
this
, as this is a JSONNumber. From source file:org.ednovo.gooru.application.client.home.HomeView.java
License:Open Source License
/** * * @function getList/*from ww w .j a va2s .co m*/ * * @created_date : Aug 5, 2014 * * @description * * * @param jsonResponse * @return * * @return : List<JSONStandardsDo> * * @throws : <Mentioned if any exceptions> * * * * */ @SuppressWarnings("deprecation") public List<JSONStandardsDo> getList(String jsonResponse) { List<JSONStandardsDo> stdList = new ArrayList<JSONStandardsDo>(); JSONValue jsonValue = JSONParser.parse(jsonResponse); JSONArray jsonArray = jsonValue.isArray(); for (int i = 0; i < jsonArray.size(); i++) { JSONObject obj = jsonArray.get(i).isObject(); if (obj != null) { JSONStandardsDo stdObj = new JSONStandardsDo(); JSONValue label = obj.get("label").isString(); JSONNumber courseId = obj.get("courseId").isNumber(); JSONNumber subjectId = obj.get("subjectId").isNumber(); JSONValue link = obj.get("link").isString(); JSONValue extraParms = obj.get("extraParms").isString(); stdObj.setLabel(label.isString().stringValue()); stdObj.setCourseId((int) courseId.isNumber().getValue()); stdObj.setSubjectId((int) subjectId.isNumber().getValue()); stdObj.setLink(link.isString().stringValue()); stdObj.setExtraParms(extraParms != null ? extraParms.isString().stringValue() : null); stdList.add(stdObj); } } return stdList; }