Re: [json-lib-user] Json Tree
Brought to you by:
aalmiray
|
From: Andres A. <aal...@ya...> - 2007-12-07 00:38:51
|
No, Json-lib will not transform a key. It assumes you are using Strings or String-friendly objects as keys, a Map as key would result in a weird key.
Map map = new HashMap();
map.put("key","value");
Map tree = new HashMap();
tree.put( map, "another value" )
JSONObject json = JSONObject.fromObject( tree )
System.out.println( json.toString(2) )
-----------------
{
"{key=value}" : "another value"
}
Cheers,
Andres
----- Original Message ----
From: Cristian Maluenda <cma...@gm...>
To: jso...@li...
Sent: Thursday, December 6, 2007 3:51:39 PM
Subject: [json-lib-user] Json Tree
Hi.
Can Json-lib convert from a Map to Json, Where the Map Key is another
Map?. I have to transform a Tree to Json, and I using Maps.
Regards,
Cristian.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
json-lib-user mailing list
jso...@li...
https://lists.sourceforge.net/lists/listinfo/json-lib-user
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs |