YUI AS Component Documentation |
Class JSON

Package | com.adobe.serialization.json
Class | public class JSON

This class provides encoding and decoding of the JSON format. Example usage: `// create a JSON string from an internal object JSON.encode( myObject ); // read a JSON string into an internal object var myObject:Object = JSON.decode( jsonString );`

Public Methods

| Method | Defined by
--- | --- | ---
|  | decode(s:String):* [static] Decodes a JSON string into a native object. | JSON
|  | encode(o:Object):String [static] Encodes a object into a JSON string. | JSON

Method detail

decode | () | method

`public static function decode(s:String):*`

Decodes a JSON string into a native object.

Parameters

| `s:String` — The JSON string representing the object

Returns

| `*` — A native object as specified by s

encode | () | method |

`public static function encode(o:Object):String`

Encodes a object into a JSON string.

Parameters

| `o:Object` — The object to create a JSON string for

Returns

| `String` — the JSON string representing o