I need to apply some function to all elements of JSON object. I guess it is named as Visitor or something like that. However JSON object (org.json.开发者_如何学CJsonObject or net.sf.json.JsonObject) are defined a bit cryptic, so if some one can point on a resource explaining how.
Assuming that you are using Java, you can look at the Javadoc to figure out how to use the JSON parser: http://json.org/javadoc/org/json/JSONObject.html
I am assuming that you need to read each element in the object. Look at the following functions: getNames (this returns all keys) and getString (returns a string of the value corresponding to a particular key).
精彩评论