I\'m thinking of something like:
String json = new JsonBuilder()
.add(\"key1\", \"value1\")
.add(\"key2\", \"value2\")
.add(\"key3\", new JsonBuilder()
It sounds like you probably want to get ahold of json-lib:
http://json-lib.sourceforge.net/
Douglas Crockford is the guy who invented JSON; his Java library is here:
http://www.json.org/java/
It sounds like the folks at json-lib picked up where Crockford left off. Both fully support JSON, both use (compatible, as far as I can tell) JSONObject, JSONArray and JSONFunction constructs.
'Hope that helps ..