Code example for JSONObject

Methods: optJSONObject

0
  } 
 
  private final NodeId contentDocument;
 
  public ChildIframeInserted(JSONObject message) throws JSONException {
    super(message);
 
    JSONObject params = message.optJSONObject("params").getJSONObject("node");
 
    JSONObject json = params.getJSONObject("contentDocument");
    contentDocument = new NodeId(json.getInt("nodeId"));
  } 
 
  public NodeId getContentDocument() { 
    return contentDocument;
  } 
 
}