JSON Support

JavaScript Object Notation (JSON) support in Apex enables the serialization of Apex objects into JSON format and the deserialization of serialized JSON content. Apex provides a set of classes that expose methods for JSON serialization and deserialization. The following table describes the classes available.
ClassDescription
System.JSONContains methods for serializing Apex objects into JSON format and deserializing JSON content that was serialized using the serialize method in this class.
System.JSONGeneratorContains methods used to serialize Apex objects into JSON content using the standard JSON encoding.
System.JSONParserRepresents a parser for JSON-encoded content.

The System.JSONToken enumeration contains the tokens used for JSON parsing.

Methods in these classes throw a JSONException if an issue is encountered during execution.

The following are some limitations of JSON support:
© Copyright 2000–2012 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.