Code example for JSONStringer

Methods: endObject, object

0
		} 
    } 
 
    public void WriteJsonObject(JSONStringer writer) throws JSONException
    { 
        writer.object();
        WriteJson(writer);
        writer.endObject();
    } 
 
    public static String WriteJson(ICanJson doc)
    { 
        JSONStringer jsonWriter = new JSONStringer();
         
        try { 
			jsonWriter.object();
			doc.WriteJson(jsonWriter);
			jsonWriter.endObject();
		} catch (JSONException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();