BSD license FREE

The BSD license is an
open-source license.
Read full license

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

Price: FREE

View Pricing 14 days money-back guarantee
(1 ratings)

Asynchronous JSON Decoder

Extremely lightweight JSON decoder with all the features you can possible want.

Share and win up to $15k in prizes each month!Learn more

Share

Description

A fully featured but lightweight JSON decoder component. Decodes a JSON string into an object using the following features:

  • Extremely lightweight with blazing performance
  • Async decoding with various settings like max processing time, max time for the whole decoding
  • Auto reprocessing, time to delay before the next async call
  • Takes advantage of the global scope property to evaluate the values of the json structure during decoding (In Development)
  • Decodes strings and keys enclosed with " or ' (can decode keys without any quotes)
  • Block and inline comments are available with export option during the decoding process
  • Exports tags from the value field (supports custom tag names by calling mapped methods)

Script Tag Evaluation Plugin is included in this package with the open source Hurlant Evaluation Library

Examples are included

Back to top

Async decoding

var decoder:JSONDecoder=new JSONDecoder();
decoder.addEventListener(Event.COMPLETE, OnDecoded);

JSONDecoder.DefaultAsyncIterationsPerMs=1500;//default iterations for 1ms - use with maxAsyncProcessTime

decoder.maxAsyncProcessTime=30;//default time in ms to process 1 async decoding frame, very useful when working with really large json objects in order to prevent application halting!

decoder.maxAsyncTime=2000;//default time in ms to prevent application halting - reduces iterations when reached

decoder.asyncTime=0;//default time to wait before the next async decoding

decoder.autoReprocessBelowPercent=.7;//default autoreprocess time - when 1 async decoding frame is finished there's a chance to process another one, if the desired iterations per frame are processed for less time

decoder.exportComments=true;//default is false - marks the option to export the string content of the inline/block comments
//Use decoder.exportedComments to access them

decoder.DecodeString(jsonString, null, true);

function OnDecoded(event:Event) : void
{
    var decodedData:Object=decoder.output[0];//Note that every json structure is considered an array. In most cases you'll get the zero indexed object
}

Questions & Comments

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.
View all 1 reviews »

User Reviews

Price: FREE

View Pricing 14 days money-back guarantee