Skip to content
Nick Ryzhy edited this page Apr 25, 2016 · 1 revision

The JSONer class lets applications import and export data using JavaScript Object Notation (JSON) format.

Name Value
Package by.blooddy.crypto.serialization
Name final class JSONer
Inheritance JSONerProcessEventDispatcherObject

Examples

Sync
import by.blooddy.crypto.serialization.JSONer;
var result:Object = JSONer.parse( '{o:0}' );
Async
import by.blooddy.crypto.serialization.JSONer;
import by.blooddy.crypto.events.ProcessEvent;

var json:JSONer = new JSONer();
json.parse( '{o:0}' );
json.addEventListener( ProcessEvent.COMPLETE, function(event:ProcessEvent):void {
	var Object = event.data;
	trace( result ); // async result
} );
json.addEventListener( ProcessEvent.ERROR, function(event:ProcessEvent):void {
	var error:Error = event.data;
	trace( error ); // async error
} );

Static Methods

Name Description
stringify(value:*):String Returns a String, in JSON format, that represents an ActionScript value. Used native JSON.stringify, if possible.
parse(value:String):* Accepts a JSON-formatted String and returns an ActionScript Object that represents that value. Used native JSON.parse, if possible.

Constructor

Name Description
JSON() Creates a JSON object.

Methods

Name Description
stringify(value:*):void Asynchronously returns a String, in JSON format, that represents an ActionScript value. Dispatched JSON string in ProcessEvent.
parse(value:String):void Asynchronously accepts a JSON-formatted String and returns an ActionScript Object that represents that value. Dispatched ActionScript Object in ProcessEvent.value.

Events

Name Type Description
complete ProcessEvent Dispatched when success.
error ProcessEvent Dispatched when fault.

Hashsum

Checksum

Image

Serialization

Clone this wiki locally