Adds advanced JSON {de}serialization capabilities to the base json library. This enhances the capabilities of dojo.toJson and dojo.fromJson, adding referencing support, date handling, and other extra format handling. On parsing, references are resolved. When references are made to ids/objects that have been loaded yet, the loader function will be set to _loadObject to denote a lazy loading (not loaded yet) object.
See the dojox/json/ref reference documentation for more information.
evaluates the passed string-form of a JSON object.
Parameter | Type | Description |
---|---|---|
str | String | a string literal of a JSON item, for instance: '{ "foo": [ "bar", 1, { "baz": "thud" } ] }' |
args | Object |
Optional See resolveJson |
An object, the result of the evaluation
Indexes and resolves references in the JSON object.
A JSON Schema object that can be used to advise the handling of the JSON (defining ids, date properties, urls, etc)
Parameter | Type | Description |
---|---|---|
root | Object | The root object of the object graph to be processed |
args | Object |
Optional Object with additional arguments:
|
An object, the result of the processing
Create a JSON serialization of an object. This has support for referencing, including circular references, duplicate references, and out-of-message references id and path-based referencing is supported as well and is based on http://www.json.com/2007/10/19/json-referencing-proposal-and-library/.
Parameter | Type | Description |
---|---|---|
it | Object | an object to be serialized. |
prettyPrint | Boolean |
Optional if true, we indent objects and arrays to make the output prettier. The variable dojo.toJsonIndentStr is used as the indent string -- to use something other than the default (tab), change that variable before calling dojo.toJson(). |
idPrefix | Object |
Optional The prefix that has been used for the absolute ids |
indexSubObjects | Object |
Optional
|
a String representing the serialized version of the passed object.