I have just finished a new plugin for Servoy called the JSON plugin, which apart from bringning a lot of new JSON-related features to Servoy addresses both the current issues with using eval() (in 3.5.x) and the current issues with the “serialize” plugin. See http://www.omnesoft.com/index.php/site/product/10 for more information.
The JSON plugin allows Servoy developers to work with strings of JSON text and JSON objects in a standard, secure and reliable way - as defined at json.org - with no dependencies on specific versions of Servoy, or specific versions of Rhino.
The JSON plugin has a lot of features that make working with JSON strings and objects simple. It also has a number of features that make converting from varying types of data into JSON, and vice versa simple. For example, the JSON plugin can convert XML to JSON and also convert JSON objects and strings of JSON to XML. It can also convert CSV text to JSON objects and convert JSON objects back to CSV. HTTP Headers, cookies and cookie lists can also be converted to and from JSON strings and objects effortlessly.
The following functions are included:
JSONObject - Construct a JSONObject from a source JSON text string.
JSONArray - Construct a JSONArray from a source JSON text.
JSONStringer - Make a fresh JSONStringer.
JSONWriter - Make a fresh JSONWriter. It can be used to build one JSON text.
XMLToJSONObject - Convert a well-formed (but not necessarily valid) XML string into a JSONObject.
JSONObjectToXML - Convert a JSONObject into a well-formed, element-normal XML string.
CDLToJSONArray - Produce a JSONArray of JSONObjects from a comma delimited text string, using the first row as a source of names.
JSONArrayToCDL - Produce a comma delimited text from a JSONArray of JSONObjects.
JSONMLToJSONArray - Convert a well-formed (but not necessarily valid) XML string into a JSONArray using the JsonML transform.
JSONArrayToJSONML - Reverse the JSONML transformation, making an XML text from a JSONArray.
HTTPHeaderToJSONObject - Convert an HTTP header string into a JSONObject.
JSONObjectToHTTPHeader - Convert a JSONObject into an HTTP header.
CookieToJSONObject - Convert a cookie specification string into a JSONObject.
JSONObjectToCookie - Convert a JSONObject into a cookie specification string.
CookieListToJSONObject - Convert a cookie list into a JSONObject.
JSONObjectToCookieList - Convert a JSONObject into a cookie list.
Feedback appreciated.