Code example for JSONStringer

0
package net.sf.lab3f.json; 
 
import org.json.JSONException; 
import org.json.JSONObject; 
import org.json.JSONStringer; 
import org.json.JSONWriter; 
 
public class Main implements JSONable{ 
 public JSONStringer getStringer(){return new JSONStringer();}	
 public JSONWriter   getWriter(java.io.Writer w){return new JSONWriter(w);}	
 public JSONObject   getObject(JSONStringer jss){
  try{return new JSONObject(jss.toString());}
  catch(JSONException ex){System.out.println(ex);return null;} 
 } 
}