ResponseParser.java 734 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * IBM Confidential
  3. *
  4. * OCO Source Materials
  5. *
  6. * IBM Cognos Products: Moser
  7. *
  8. * (C) Copyright IBM Corp. 2020
  9. *
  10. * The source code for this program is not published or otherwise
  11. * divested of its trade secrets, irrespective of what has been
  12. * deposited with the U.S. Copyright Office.
  13. */
  14. package com.ibm.bi.platform.modeling.sdk.examples;
  15. import java.io.IOException;
  16. import com.ibm.json.java.JSONArray;
  17. import com.ibm.json.java.JSONObject;
  18. /**
  19. * @author nbalaba
  20. *
  21. */
  22. public class ResponseParser {
  23. public static void parseResponse(String json) throws IOException{
  24. JSONObject response = JSONObject.parse(json);
  25. if( response.containsKey("data")){
  26. JSONArray data = (JSONArray) response.get("data");
  27. }
  28. }
  29. }