Json class

From m204wiki
Revision as of 18:28, 17 February 2015 by Alex (talk | contribs) (Created page with "<!-- Json class --> The <var>Json</var> class facilitates data exchange with [http://en.wikipedia.org/wiki/JavaScript JavaScript] programs or other programs that suport the [h...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Json class facilitates data exchange with JavaScript programs or other programs that suport the JSON format. JSON can be considered as an alternative encoding format to XML which is supported in SOUL by the XmlDoc API. The advantages of JSON over XML are:

  • It is easier to use in JavaScript programs.
  • It maps more naturally on to object-oriented structures, especially collections.
  • It is lighter-weight. That is, data represented as JSON is typically more compact than the same data represented as XML and the JSON standard is considerably simpler than the XML standard.

All that said, there are many situations where XML is a better choice for an exchange format than JSON.

Json objects would typically be created either programmatically using JSON constructors or by parsing a JSON string sent from another platform. A Json object tree can be examined and manipulated using a set of Json functions and the resulting object tree can be serialized as a string. The Json parsing and serialization functions operate only on unicode so a separate step is required to encode/decode the data to/from a format suitable for network transfer, most commonly UTF-8.

List of Json methods

List of Json methods contains a complete list of the class methods.