Code example for JSONStringer

Methods: key

0
 
    public static void WriteIdAndRev(ICouchDocument doc, JSONStringer writer) throws JSONException
    { 
        if (doc.Id() != null)
        { 
            writer.key("_id").value(doc.Id());
        } 
        if (doc.Rev() != null)
        { 
            writer.key("_rev").value(doc.Rev());
        } 
    } 
 
    public static void ReadIdAndRev(ICouchDocument doc, JSONObject obj) throws JSONException
    { 
    	doc.Id(obj.getString("_id"));
    	doc.Rev(obj.getString("_rev"));
    } 
 
	@Override 
	public String Id() {