JSONObject to Map

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JSONObject to Map

byersa
Is there a simple way to convert a JSONObject to its HashMap repesentation?

Thanks,
-Al
Reply | Threaded
Open this post in threaded view
|

Re: JSONObject to Map

cjhowe
An older version of json-lib is included in the project.  The javadocs are here http://json-lib.sourceforge.net/apidocs/jdk15/index.html

----- Original Message ----
From: Al Byers <[hidden email]>
To: [hidden email]
Sent: Friday, December 14, 2007 4:14:37 PM
Subject: JSONObject to Map


Is there a simple way to convert a JSONObject to its HashMap
 repesentation?

Thanks,
-Al



Reply | Threaded
Open this post in threaded view
|

Re: JSONObject to Map

byersa
Thanks Chris,

It looks like the answer is this:
        Map bean = (Map)JSONObject.toBean(json, java.util.HashMap.class);

-Al