├── README.mkd ├── docs ├── all-classes.html ├── all-index-A.html ├── all-index-B.html ├── all-index-C.html ├── all-index-D.html ├── all-index-E.html ├── all-index-F.html ├── all-index-G.html ├── all-index-H.html ├── all-index-I.html ├── all-index-J.html ├── all-index-K.html ├── all-index-L.html ├── all-index-M.html ├── all-index-N.html ├── all-index-O.html ├── all-index-P.html ├── all-index-Q.html ├── all-index-R.html ├── all-index-S.html ├── all-index-T.html ├── all-index-U.html ├── all-index-V.html ├── all-index-W.html ├── all-index-X.html ├── all-index-Y.html ├── all-index-Z.html ├── appendixes.html ├── asdoc.js ├── br │ └── com │ │ └── stimuli │ │ └── loading │ │ ├── BulkLoader.html │ │ ├── BulkProgressEvent.html │ │ ├── Connection.html │ │ ├── LazyBulkLoader.html │ │ ├── LazyXMLLoader.html │ │ ├── LoadingItem.html │ │ ├── class-list.html │ │ ├── lazyloaders │ │ ├── LazyBulkLoader.html │ │ ├── LazyJSONLoader.html │ │ ├── LazyXMLLoader.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ ├── loadingtypes │ │ ├── BinaryItem.html │ │ ├── ImageItem.html │ │ ├── LoadingItem.html │ │ ├── SoundItem.html │ │ ├── URLItem.html │ │ ├── VideoItem.html │ │ ├── XMLItem.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ └── package-detail.html ├── class-summary.html ├── cookies.js ├── images │ ├── collapsed.gif │ ├── detailHeaderRule.jpg │ ├── detailSectionHeader.jpg │ ├── expanded.gif │ ├── inherit-arrow.gif │ ├── inheritedSummary.gif │ ├── logo.jpg │ ├── titleTableBottom.jpg │ ├── titleTableMiddle.jpg │ └── titleTableTop.jpg ├── index-list.html ├── index.html ├── mxml-tags.html ├── package-frame.html ├── package-list.html ├── package-summary.html ├── print.css ├── style.css └── title-bar.html ├── examples ├── serialized-loaders │ ├── AC_RunActiveContent.js │ ├── SerializedTestMain.as │ ├── serialized-test.fla │ ├── serialized-test.html │ └── serialized-test.swf └── simple-example │ ├── SimpleExampleMain.as │ ├── simple-example.fla │ └── simple-example.swf ├── inspector ├── Bootstrapper.as ├── BulkLoaderInspectorBootstrapper.fla ├── BulkLoaderInspectorBootstrapper.swf └── fl-project │ ├── .actionScriptProperties │ ├── .flexProperties │ ├── .project │ ├── .settings │ └── org.eclipse.core.resources.prefs │ ├── src │ ├── BulkLoaderInspectorContainer.mxml │ └── br │ │ └── com │ │ └── stimuli │ │ └── loading │ │ ├── BulkLoaderInspectorPanel.mxml │ │ ├── ItemDetailCanvas.mxml │ │ ├── LoaderInspector.mxml │ │ └── LoadingItemRenderer.as │ └── www │ ├── BulkLoaderInspectorContainer.swf │ ├── index.html │ └── swfobject.js ├── src └── br │ └── com │ └── stimuli │ └── loading │ ├── BulkLoader.as │ ├── BulkProgressEvent.as │ ├── lazyloaders │ ├── LazyBulkLoader.as │ ├── LazyJSONLoader.as │ └── LazyXMLLoader.as │ ├── loadingtypes │ ├── BinaryItem.as │ ├── ImageItem.as │ ├── JSONItem.as │ ├── LoadingItem.as │ ├── SoundItem.as │ ├── URLItem.as │ ├── VideoItem.as │ └── XMLItem.as │ └── utils │ └── SmartURL.as ├── swc └── bulk_loader.swc └── tests ├── bin ├── AC_RunActiveContent.js ├── TestSuite.html └── TestSuite.swf ├── src ├── BulkLoaderTestRunner.mxml └── br │ └── com │ └── stimuli │ └── loading │ └── tests │ ├── AudioContentTest.as │ ├── AutoIdTest.as │ ├── BaseAssyncTest.as │ ├── BulkLoaderTestSuite.as │ ├── BulkStartTest.as │ ├── ClearMemoryTest.as │ ├── ClearNowTest.as │ ├── CollectionTestCase.as │ ├── ErrorResumeTest.as │ ├── GetClassDefinitionTest.as │ ├── GuessTypeTest.as │ ├── HasItemTest.as │ ├── HostPriorityTest.as │ ├── InstanceRetrivalTestCase.as │ ├── LazyJSONLoaderTest.as │ ├── LazyXMLInternalsTest.as │ ├── LazyXMLLoaderTest.as │ ├── LoadNowTest.as │ ├── LoaderImageItemTest.as │ ├── LoaderItemAVM1MovieTest.as │ ├── LoaderItemMovieTest.as │ ├── OnCompleteTest.as │ ├── OnErrorTest.as │ ├── PauseAllResumeTest.as │ ├── ProgressEventsTest.as │ ├── RegisterNewTypeTest.as │ ├── ReloadTest.as │ ├── RemoveAllSimpleTest.as │ ├── RemoveAllTest.as │ ├── RemoveFailedItemTest.as │ ├── ResumeAllTest.as │ ├── ResumeTest.as │ ├── SmartURLTest.as │ ├── StartPausedTest.as │ ├── StringSubstituionTest.as │ ├── TwoItemsWithTheSameURLTest.as │ ├── URLItemTest.as │ ├── VideoContentPausedAtStartTestCase.as │ ├── VideoContentTest.as │ └── XMLItemTest.as └── third-parties └── src ├── br └── com │ └── stimuli │ └── kisstest │ ├── TestCase.as │ ├── TestResult.as │ ├── TestRunner.as │ ├── TestSuite.as │ ├── events │ ├── AssertionFailedEvent.as │ ├── AssertionSuccessEvent.as │ ├── TestEvent.as │ └── TestResultEvent.as │ └── runners │ ├── GUIFlexRunner.mxml │ └── TraceRunner.as └── com └── adobe └── serialization └── json ├── JSON.as ├── JSONDecoder.as ├── JSONEncoder.as ├── JSONParseError.as ├── JSONToken.as ├── JSONTokenType.as └── JSONTokenizer.as /README.mkd: -------------------------------------------------------------------------------- 1 | BulkLoader is a minimal library written in Actionscript 3 (AS3) that aims to make loading and managing complex loading requirements easier and faster. BulkLoader takes a more dynamic, less architecture heavy approach. Few imports and making heavy use of AS3's dynamic capabilities, BulkLoader has a one-liner feel that doesn't get in your way. 2 | 3 | BulkLoader hides the complexity of loading different data types in AS3 and provides a unified interface for loading, accessing and events notification for different types of content. 4 | 5 | This library is licensed under an open source MIT license. 6 | Features: 7 | 8 | * Connection pooling. 9 | * Unified interface for different loading types. 10 | * Unified progress notification. 11 | * Events for individual items and as groups. 12 | * Priority 13 | * Stop and resuming individually as well as in bulk. 14 | * Cache management. 15 | * Statistics about loading (latency, speed, average speed). 16 | * Various kinds on progress indication: ratio (items loaded / items to load), bytes , and weighted percentage. 17 | * Configurable number of retries. 18 | * Configurable logging. 19 | * Various assets types (XML, NetStreams, Swfs, Images, Sound, Text Files) 20 | 21 | Design goals: 22 | 23 | * Minimal imports. 24 | * Few method to learn. 25 | * Consistent interface, regardless of content type. 26 | 27 | BulkLoader gracefully handles progress notification in these use cases: 28 | 29 | * Few connections to open: bytes total can be used instantly. 30 | * Many connections opened: progress by ratio 31 | * Many connections opened for data of widely varying sizes: progress by weight. 32 | 33 | 34 | Useful links: 35 | 36 | * The [FAQ](http://github.com/arthur-debert/BulkLoader/wiki/FAQ) has the answer to the most common questions. 37 | * The [WIKI](http://github.com/arthur-debert/BulkLoader/wiki) has a lot of user guides. 38 | * The [Original announcement](http://www.stimuli.com.br/trane/2007/nov/25/loading-reloaded/) . 39 | * The [Mailing list](http://groups.google.com/group/bulkloader-users) . This is where support request and usage questions should be directed. 40 | * The [Online documentation](http://media.stimuli.com.br/projects/bulk-loader/docs/) for asdoc style help. 41 | 42 | Thank you 43 | -------------------------------------------------------------------------------- /docs/all-classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |BulkLoader | 17 |
BulkProgressEvent | 20 |
LoadingItem | 23 |
SmartURL | 26 |
Appendix | Description | 37 |
---|
Package | br.com.stimuli.loading | 36 |
Class | public class Connection | 39 |
Method | Defined by | 53 |||
---|---|---|---|
56 |
57 | Connection()
58 |
59 |
60 | | Connection | 61 |
Connection | () | constructor | 75 |
public function Connection()
79 |
Classes | 17 |
BulkLoader | 20 |
BulkProgressEvent | 23 |
Classes | 17 |
LazyBulkLoader | 20 |
LazyJSONLoader | 23 |
LazyXMLLoader | 26 |
Class | Description | 40 ||
---|---|---|
LazyBulkLoader | A serialized version of af BulkLoader instance. | 43 ||
LazyJSONLoader | 46 | | |
LazyXMLLoader | 49 | |
Classes | 17 |
LoadingItem | 20 |
Class | Description | 40 ||
---|---|---|
LoadingItem |
43 | An class used in BulkLoader instances.. |
44 |
Class | Description | 40 ||
---|---|---|
BulkLoader | 43 | Manages loading for simultaneous items and multiple formats. | 44 ||
BulkProgressEvent |
47 | An event that holds information about the status of a BulkLoader . |
48 |
A | 27 |N | 28 | 29 |
B | 34 |O | 35 | 36 |
C | 41 |P | 42 | 43 |
D | 48 |Q | 49 | 50 |
E | 55 |R | 56 | 57 |
F | 62 |S | 63 | 64 |
G | 69 |T | 70 | 71 |
H | 76 |U | 77 | 78 |
I | 83 |V | 84 | 85 |
J | 90 |W | 91 | 92 |
K | 97 |X | 98 | 99 |
L | 104 |Y | 105 | 106 |
M | 111 |Z | 112 | 113 |
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
24 |
25 | Link toNon-frame version.
26 |
27 |
br.com.stimuli.loading
18 | 19 | |
20 |
br.com.stimuli.loading.loadingtypes
23 | 24 | |
25 |
br.com.stimuli.loading.utils | 28 |
Package | Description | 37 ||
---|---|---|
br.com.stimuli.loading | 40 | | |
br.com.stimuli.loading.loadingtypes | 43 | | |
br.com.stimuli.loading.utils | 46 | |
BulkLoader | 25 |26 | All Packages | All Classes | Index | No Frames 27 | | 28 | 29 |30 | 31 | | 32 | 33 |
38 | | 39 | | 41 | 42 | 40 ||
47 | 48 | |
items
and attach events to them accordingly.
14 | *
15 | * @eventType br.com.stimuli.loading.BulkProgressEvent.PROGRESS
16 | */
17 | [Event(name="lazyComplete", type="flash.events.Event")];
18 | /** A serialized version of af BulkLoader instance. This class allows you to keep external files with a complete description of what loading items should be loaded. This class is not meant to be used directly, but used as a base classes for specific data transports (xml, json).
19 | *
20 | */
21 | public class LazyBulkLoader extends BulkLoader {
22 | namespace lazy_loader = "http://code.google.com/p/bulk-loader/";
23 | lazy_loader var _lazyTheURL : URLRequest;
24 | /** @private */
25 | lazy_loader var _lazyLoader : URLLoader;
26 | /** @private */
27 | lazy_loader static const INT_TYPES : Array = ["maxTries", "priority"];
28 | /** @private */
29 | lazy_loader static const NUMBER_TYPES : Array = ["weigth"];
30 | /** @private */
31 | lazy_loader static const STRINGED_BOOLEAN : Array = ["preventCache", "pausedAtStart", "checkPolicyFile"];
32 | public static const LAZY_COMPLETE : String = "lazyComplete";
33 |
34 | public function LazyBulkLoader(url : *, name : String, numConnections : int = BulkLoader.DEFAULT_NUM_CONNECTIONS, logLevel : int = BulkLoader.DEFAULT_LOG_LEVEL){
35 |
36 | if (url is String) {
37 | lazy_loader::_lazyTheURL = new URLRequest(url);
38 | }
39 | lazy_loader::_lazyTheURL = (lazy_loader::_lazyTheURL as URLRequest) || url;
40 | super(name, numConnections, logLevel);
41 | }
42 |
43 | /** Starts to fetch the external data that will define a BulkLoader instance when parsed. When the fetch operation
44 | * is done and the item is correctly parsed, it will dispatch an event with name LAZY_COMPLETE
.
45 | */
46 | override public function start(numConnections : int = -1):void {
47 | if (numConnections > 0){
48 | this._numConnections = numConnections;
49 | }
50 | lazy_loader::_lazyLoader = new URLLoader(lazy_loader::_lazyTheURL);
51 | lazy_loader::_lazyLoader.addEventListener(Event.COMPLETE, lazy_loader::_lazyOnComplete, false, 0, true);
52 | }
53 |
54 | /** @private */
55 | lazy_loader function _lazyOnComplete(evt : Event):void {
56 | lazy_loader::_lazyParseLoader(evt.target.data);
57 | dispatchEvent(new Event(LAZY_COMPLETE));
58 | super.start();
59 | }
60 |
61 | /** Useful subclasses should implement this method for a specific seralization method. The String
to be turned into a BulkLoader
instance.
64 | * @private
65 | */
66 | lazy_loader function _lazyParseLoader(withData : String) : void{
67 | throw new Error("subclasses should implement a useful method for this");
68 | }
69 |
70 | /** @private */
71 | lazy_loader static function toBoolean(value : String):Boolean {
72 | if (value == "true" || value == "1" || value == "yes") {
73 | return true;
74 | }
75 | return false;
76 | }
77 |
78 | override public function toString():String {
79 | return "[LazyBulkLoader] url: " + lazy_loader::_lazyTheURL.url + ", bulkloader: " + super.toString();
80 | }
81 |
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/br/com/stimuli/loading/lazyloaders/LazyJSONLoader.as:
--------------------------------------------------------------------------------
1 | package br.com.stimuli.loading.lazyloaders{
2 | import br.com.stimuli.loading.*;
3 | import br.com.stimuli.loading.loadingtypes.*;
4 | import br.com.stimuli.loading.lazyloaders.*;
5 | import flash.events.*;
6 | import flash.net.*;
7 | import flash.display.*;
8 | import flash.media.Sound;
9 | import flash.utils.*;
10 | import flash.system.LoaderContext;
11 | import flash.system.ApplicationDomain;
12 | import flash.media.SoundLoaderContext;
13 | /**
14 | * @example Basic usage:oString(true)
will output a verbose version of this URL.
46 | **/
47 | public function toString(...rest) : String{
48 | if (rest.length > 0 && rest[0] == true){
49 | return "[URL] rawString :" + rawString + ", protocol: " + protocol + ", port: " + port + ", host: " + host + ", path: " + path + ". queryLength: " + queryLength;
50 | }
51 | return rawString;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/swc/bulk_loader.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arthur-debert/BulkLoader/56c74f4a64b093c09a11ba2f5d984ad58e7c91c5/swc/bulk_loader.swc
--------------------------------------------------------------------------------
/tests/bin/TestSuite.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
41 | * // create a JSON string from an internal object
42 | * JSON.encode( myObject );
43 | *
44 | * // read a JSON string into an internal object
45 | * var myObject:Object = JSON.decode( jsonString );
46 | *
47 | */
48 | public class JSON
49 | {
50 | /**
51 | * Encodes a object into a JSON string.
52 | *
53 | * @param o The object to create a JSON string for
54 | * @return the JSON string representing o
55 | * @langversion ActionScript 3.0
56 | * @playerversion Flash 9.0
57 | * @tiptext
58 | */
59 | public static function encode( o:Object ):String
60 | {
61 | return new JSONEncoder( o ).getString();
62 | }
63 |
64 | /**
65 | * Decodes a JSON string into a native object.
66 | *
67 | * @param s The JSON string representing the object
68 | * @param strict Flag indicating if the decoder should strictly adhere
69 | * to the JSON standard or not. The default of true
70 | * throws errors if the format does not match the JSON syntax exactly.
71 | * Pass false
to allow for non-properly-formatted JSON
72 | * strings to be decoded with more leniancy.
73 | * @return A native object as specified by s
74 | * @throw JSONParseError
75 | * @langversion ActionScript 3.0
76 | * @playerversion Flash 9.0
77 | * @tiptext
78 | */
79 | public static function decode( s:String, strict:Boolean = true ):*
80 | {
81 | return new JSONDecoder( s, strict ).getValue();
82 | }
83 |
84 | }
85 |
86 | }
--------------------------------------------------------------------------------
/tests/third-parties/src/com/adobe/serialization/json/JSONParseError.as:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Adobe Systems Incorporated
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are
7 | met:
8 |
9 | * Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | * Neither the name of Adobe Systems Incorporated nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | package com.adobe.serialization.json {
34 |
35 | /**
36 | *
37 | *
38 | */
39 | public class JSONParseError extends Error {
40 |
41 | /** The location in the string where the error occurred */
42 | private var _location:int;
43 |
44 | /** The string in which the parse error occurred */
45 | private var _text:String;
46 |
47 | /**
48 | * Constructs a new JSONParseError.
49 | *
50 | * @param message The error message that occured during parsing
51 | * @langversion ActionScript 3.0
52 | * @playerversion Flash 9.0
53 | * @tiptext
54 | */
55 | public function JSONParseError( message:String = "", location:int = 0, text:String = "") {
56 | super( message );
57 | name = "JSONParseError";
58 | _location = location;
59 | _text = text;
60 | }
61 |
62 | /**
63 | * Provides read-only access to the location variable.
64 | *
65 | * @return The location in the string where the error occurred
66 | * @langversion ActionScript 3.0
67 | * @playerversion Flash 9.0
68 | * @tiptext
69 | */
70 | public function get location():int {
71 | return _location;
72 | }
73 |
74 | /**
75 | * Provides read-only access to the text variable.
76 | *
77 | * @return The string in which the error occurred
78 | * @langversion ActionScript 3.0
79 | * @playerversion Flash 9.0
80 | * @tiptext
81 | */
82 | public function get text():String {
83 | return _text;
84 | }
85 | }
86 |
87 | }
--------------------------------------------------------------------------------
/tests/third-parties/src/com/adobe/serialization/json/JSONToken.as:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Adobe Systems Incorporated
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are
7 | met:
8 |
9 | * Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | * Neither the name of Adobe Systems Incorporated nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | package com.adobe.serialization.json {
34 |
35 | public class JSONToken {
36 |
37 | private var _type:int;
38 | private var _value:Object;
39 |
40 | /**
41 | * Creates a new JSONToken with a specific token type and value.
42 | *
43 | * @param type The JSONTokenType of the token
44 | * @param value The value of the token
45 | * @langversion ActionScript 3.0
46 | * @playerversion Flash 9.0
47 | * @tiptext
48 | */
49 | public function JSONToken( type:int = -1 /* JSONTokenType.UNKNOWN */, value:Object = null ) {
50 | _type = type;
51 | _value = value;
52 | }
53 |
54 | /**
55 | * Returns the type of the token.
56 | *
57 | * @see com.adobe.serialization.json.JSONTokenType
58 | * @langversion ActionScript 3.0
59 | * @playerversion Flash 9.0
60 | * @tiptext
61 | */
62 | public function get type():int {
63 | return _type;
64 | }
65 |
66 | /**
67 | * Sets the type of the token.
68 | *
69 | * @see com.adobe.serialization.json.JSONTokenType
70 | * @langversion ActionScript 3.0
71 | * @playerversion Flash 9.0
72 | * @tiptext
73 | */
74 | public function set type( value:int ):void {
75 | _type = value;
76 | }
77 |
78 | /**
79 | * Gets the value of the token
80 | *
81 | * @see com.adobe.serialization.json.JSONTokenType
82 | * @langversion ActionScript 3.0
83 | * @playerversion Flash 9.0
84 | * @tiptext
85 | */
86 | public function get value():Object {
87 | return _value;
88 | }
89 |
90 | /**
91 | * Sets the value of the token
92 | *
93 | * @see com.adobe.serialization.json.JSONTokenType
94 | * @langversion ActionScript 3.0
95 | * @playerversion Flash 9.0
96 | * @tiptext
97 | */
98 | public function set value ( v:Object ):void {
99 | _value = v;
100 | }
101 |
102 | }
103 |
104 | }
--------------------------------------------------------------------------------
/tests/third-parties/src/com/adobe/serialization/json/JSONTokenType.as:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Adobe Systems Incorporated
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are
7 | met:
8 |
9 | * Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | * Neither the name of Adobe Systems Incorporated nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | package com.adobe.serialization.json {
34 |
35 | /**
36 | * Class containing constant values for the different types
37 | * of tokens in a JSON encoded string.
38 | */
39 | public class JSONTokenType {
40 |
41 | public static const UNKNOWN:int = -1;
42 |
43 | public static const COMMA:int = 0;
44 |
45 | public static const LEFT_BRACE:int = 1;
46 |
47 | public static const RIGHT_BRACE:int = 2;
48 |
49 | public static const LEFT_BRACKET:int = 3;
50 |
51 | public static const RIGHT_BRACKET:int = 4;
52 |
53 | public static const COLON:int = 6;
54 |
55 | public static const TRUE:int = 7;
56 |
57 | public static const FALSE:int = 8;
58 |
59 | public static const NULL:int = 9;
60 |
61 | public static const STRING:int = 10;
62 |
63 | public static const NUMBER:int = 11;
64 |
65 | public static const NAN:int = 12;
66 |
67 | }
68 |
69 | }
--------------------------------------------------------------------------------