mas01mj@732: /* mas01mj@732: Copyright (c) 2008, Adobe Systems Incorporated mas01mj@732: All rights reserved. mas01mj@732: mas01mj@732: Redistribution and use in source and binary forms, with or without mas01mj@732: modification, are permitted provided that the following conditions are mas01mj@732: met: mas01mj@732: mas01mj@732: * Redistributions of source code must retain the above copyright notice, mas01mj@732: this list of conditions and the following disclaimer. mas01mj@732: mas01mj@732: * Redistributions in binary form must reproduce the above copyright mas01mj@732: notice, this list of conditions and the following disclaimer in the mas01mj@732: documentation and/or other materials provided with the distribution. mas01mj@732: mas01mj@732: * Neither the name of Adobe Systems Incorporated nor the names of its mas01mj@732: contributors may be used to endorse or promote products derived from mas01mj@732: this software without specific prior written permission. mas01mj@732: mas01mj@732: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS mas01mj@732: IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, mas01mj@732: THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR mas01mj@732: PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR mas01mj@732: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, mas01mj@732: EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, mas01mj@732: PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR mas01mj@732: PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF mas01mj@732: LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING mas01mj@732: NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS mas01mj@732: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. mas01mj@732: */ mas01mj@732: mas01mj@732: package com.adobe.serialization.json { mas01mj@732: mas01mj@732: public class JSONToken { mas01mj@732: mas01mj@732: private var _type:int; mas01mj@732: private var _value:Object; mas01mj@732: mas01mj@732: /** mas01mj@732: * Creates a new JSONToken with a specific token type and value. mas01mj@732: * mas01mj@732: * @param type The JSONTokenType of the token mas01mj@732: * @param value The value of the token mas01mj@732: * @langversion ActionScript 3.0 mas01mj@732: * @playerversion Flash 9.0 mas01mj@732: * @tiptext mas01mj@732: */ mas01mj@732: public function JSONToken( type:int = -1 /* JSONTokenType.UNKNOWN */, value:Object = null ) { mas01mj@732: _type = type; mas01mj@732: _value = value; mas01mj@732: } mas01mj@732: mas01mj@732: /** mas01mj@732: * Returns the type of the token. mas01mj@732: * mas01mj@732: * @see com.adobe.serialization.json.JSONTokenType mas01mj@732: * @langversion ActionScript 3.0 mas01mj@732: * @playerversion Flash 9.0 mas01mj@732: * @tiptext mas01mj@732: */ mas01mj@732: public function get type():int { mas01mj@732: return _type; mas01mj@732: } mas01mj@732: mas01mj@732: /** mas01mj@732: * Sets the type of the token. mas01mj@732: * mas01mj@732: * @see com.adobe.serialization.json.JSONTokenType mas01mj@732: * @langversion ActionScript 3.0 mas01mj@732: * @playerversion Flash 9.0 mas01mj@732: * @tiptext mas01mj@732: */ mas01mj@732: public function set type( value:int ):void { mas01mj@732: _type = value; mas01mj@732: } mas01mj@732: mas01mj@732: /** mas01mj@732: * Gets the value of the token mas01mj@732: * mas01mj@732: * @see com.adobe.serialization.json.JSONTokenType mas01mj@732: * @langversion ActionScript 3.0 mas01mj@732: * @playerversion Flash 9.0 mas01mj@732: * @tiptext mas01mj@732: */ mas01mj@732: public function get value():Object { mas01mj@732: return _value; mas01mj@732: } mas01mj@732: mas01mj@732: /** mas01mj@732: * Sets the value of the token mas01mj@732: * mas01mj@732: * @see com.adobe.serialization.json.JSONTokenType mas01mj@732: * @langversion ActionScript 3.0 mas01mj@732: * @playerversion Flash 9.0 mas01mj@732: * @tiptext mas01mj@732: */ mas01mj@732: public function set value ( v:Object ):void { mas01mj@732: _value = v; mas01mj@732: } mas01mj@732: mas01mj@732: } mas01mj@732: mas01mj@732: }