亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jsonencoder.as

?? coldfusion服務(wù)器 air程序的更新源代碼
?? AS
字號(hào):
/*
Adobe Systems Incorporated(r) Source Code License Agreement
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
	
Please read this Source Code License Agreement carefully before using
the source code.
	
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable copyright license, to reproduce,
prepare derivative works of, publicly display, publicly perform, and
distribute this source code and such derivative works in source or
object code form without any attribution requirements.
	
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
derived from the source code without prior written permission.
	
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
against any loss, damage, claims or lawsuits, including attorney's
fees that arise or result from your use or distribution of the source
code.
	
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.adobe.serialization.json 
{

	import flash.utils.describeType;

	public class JSONEncoder {
	
		/** The string that is going to represent the object we're encoding */
		private var jsonString:String;
		
		/**
		 * Creates a new JSONEncoder.
		 *
		 * @param o The object to encode as a JSON string
		 * @langversion ActionScript 3.0
		 * @playerversion Flash 9.0
		 * @tiptext
		 */
		public function JSONEncoder( value:* ) {
			jsonString = convertToString( value );
		
		}
		
		/**
		 * Gets the JSON string from the encoder.
		 *
		 * @return The JSON string representation of the object
		 * 		that was passed to the constructor
		 * @langversion ActionScript 3.0
		 * @playerversion Flash 9.0
		 * @tiptext
		 */
		public function getString():String {
			return jsonString;
		}
		
		/**
		 * Converts a value to it's JSON string equivalent.
		 *
		 * @param value The value to convert.  Could be any 
		 *		type (object, number, array, etc)
		 */
		private function convertToString( value:* ):String {
			
			// determine what value is and convert it based on it's type
			if ( value is String ) {
				
				// escape the string so it's formatted correctly
				return escapeString( value as String );
				
			} else if ( value is Number ) {
				
				// only encode numbers that finate
				return isFinite( value as Number) ? value.toString() : "null";

			} else if ( value is Boolean ) {
				
				// convert boolean to string easily
				return value ? "true" : "false";

			} else if ( value is Array ) {
			
				// call the helper method to convert an array
				return arrayToString( value as Array );
			
			} else if ( value is Object && value != null ) {
			
				// call the helper method to convert an object
				return objectToString( value );
			}
            return "null";
		}
		
		/**
		 * Escapes a string accoding to the JSON specification.
		 *
		 * @param str The string to be escaped
		 * @return The string with escaped special characters
		 * 		according to the JSON specification
		 */
		private function escapeString( str:String ):String {
			// create a string to store the string's jsonstring value
			var s:String = "";
			// current character in the string we're processing
			var ch:String;
			// store the length in a local variable to reduce lookups
			var len:Number = str.length;
			
			// loop over all of the characters in the string
			for ( var i:int = 0; i < len; i++ ) {
			
				// examine the character to determine if we have to escape it
				ch = str.charAt( i );
				switch ( ch ) {
				
					case '"':	// quotation mark
						s += "\\\"";
						break;
						
					//case '/':	// solidus
					//	s += "\\/";
					//	break;
						
					case '\\':	// reverse solidus
						s += "\\\\";
						break;
						
					case '\b':	// bell
						s += "\\b";
						break;
						
					case '\f':	// form feed
						s += "\\f";
						break;
						
					case '\n':	// newline
						s += "\\n";
						break;
						
					case '\r':	// carriage return
						s += "\\r";
						break;
						
					case '\t':	// horizontal tab
						s += "\\t";
						break;
						
					default:	// everything else
						
						// check for a control character and escape as unicode
						if ( ch < ' ' ) {
							// get the hex digit(s) of the character (either 1 or 2 digits)
							var hexCode:String = ch.charCodeAt( 0 ).toString( 16 );
							
							// ensure that there are 4 digits by adjusting
							// the # of zeros accordingly.
							var zeroPad:String = hexCode.length == 2 ? "00" : "000";
							
							// create the unicode escape sequence with 4 hex digits
							s += "\\u" + zeroPad + hexCode;
						} else {
						
							// no need to do any special encoding, just pass-through
							s += ch;
							
						}
				}	// end switch
				
			}	// end for loop
						
			return "\"" + s + "\"";
		}
		
		/**
		 * Converts an array to it's JSON string equivalent
		 *
		 * @param a The array to convert
		 * @return The JSON string representation of <code>a</code>
		 */
		private function arrayToString( a:Array ):String {
			// create a string to store the array's jsonstring value
			var s:String = "";
			
			// loop over the elements in the array and add their converted
			// values to the string
			for ( var i:int = 0; i < a.length; i++ ) {
				// when the length is 0 we're adding the first element so
				// no comma is necessary
				if ( s.length > 0 ) {
					// we've already added an element, so add the comma separator
					s += ","
				}
				
				// convert the value to a string
				s += convertToString( a[i] );	
			}
			
			// KNOWN ISSUE:  In ActionScript, Arrays can also be associative
			// objects and you can put anything in them, ie:
			//		myArray["foo"] = "bar";
			//
			// These properties aren't picked up in the for loop above because
			// the properties don't correspond to indexes.  However, we're
			// sort of out luck because the JSON specification doesn't allow
			// these types of array properties.
			//
			// So, if the array was also used as an associative object, there
			// may be some values in the array that don't get properly encoded.
			//
			// A possible solution is to instead encode the Array as an Object
			// but then it won't get decoded correctly (and won't be an
			// Array instance)
						
			// close the array and return it's string value
			return "[" + s + "]";
		}
		
		/**
		 * Converts an object to it's JSON string equivalent
		 *
		 * @param o The object to convert
		 * @return The JSON string representation of <code>o</code>
		 */
		private function objectToString( o:Object ):String
		{
			// create a string to store the object's jsonstring value
			var s:String = "";
			
			// determine if o is a class instance or a plain object
			var classInfo:XML = describeType( o );
			if ( classInfo.@name.toString() == "Object" )
			{
				// the value of o[key] in the loop below - store this 
				// as a variable so we don't have to keep looking up o[key]
				// when testing for valid values to convert
				var value:Object;
				
				// loop over the keys in the object and add their converted
				// values to the string
				for ( var key:String in o )
				{
					// assign value to a variable for quick lookup
					value = o[key];
					
					// don't add function's to the JSON string
					if ( value is Function )
					{
						// skip this key and try another
						continue;
					}
					
					// when the length is 0 we're adding the first item so
					// no comma is necessary
					if ( s.length > 0 ) {
						// we've already added an item, so add the comma separator
						s += ","
					}
					
					s += escapeString( key ) + ":" + convertToString( value );
				}
			}
			else // o is a class instance
			{
				// Loop over all of the variables and accessors in the class and 
				// serialize them along with their values.
				for each ( var v:XML in classInfo..*.( name() == "variable" || name() == "accessor" ) )
				{
					// When the length is 0 we're adding the first item so
					// no comma is necessary
					if ( s.length > 0 ) {
						// We've already added an item, so add the comma separator
						s += ","
					}
					
					s += escapeString( v.@name.toString() ) + ":" 
							+ convertToString( o[ v.@name ] );
				}
				
			}
			
			return "{" + s + "}";
		}

		
	}
	
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看日韩电影| 不卡视频一二三| 欧美综合色免费| 欧美精品久久一区二区三区| 综合色中文字幕| 久久久久97国产精华液好用吗| 日本一区二区视频在线| 亚洲线精品一区二区三区| 加勒比av一区二区| 色激情天天射综合网| 久久婷婷色综合| 亚洲h在线观看| 91麻豆自制传媒国产之光| 久久综合久久综合久久综合| 午夜精品在线看| 99久久精品免费看| 欧美极品美女视频| 久久国产尿小便嘘嘘| 欧美日韩一区在线观看| 自拍偷拍亚洲综合| 成人网在线播放| 欧美大片国产精品| 777午夜精品视频在线播放| 久久久影视传媒| 秋霞电影网一区二区| 欧美视频精品在线| 一区二区三区中文字幕电影| 99re视频这里只有精品| 国产婷婷一区二区| 国产一本一道久久香蕉| 欧美成人aa大片| 蜜桃视频一区二区三区| 日韩欧美一级精品久久| 亚洲chinese男男1069| 欧美亚洲动漫制服丝袜| 亚洲欧美另类久久久精品| 国产福利一区二区三区| 国产人妖乱国产精品人妖| 国产精品自拍av| 欧美韩日一区二区三区| bt7086福利一区国产| 国产精品久久久久久久久免费樱桃 | 亚洲欧美中日韩| 国产成人精品综合在线观看| 欧美国产欧美亚州国产日韩mv天天看完整| 国产麻豆视频一区| 国产精品全国免费观看高清 | 国产精品进线69影院| 国产成人在线观看免费网站| 国产欧美日韩综合精品一区二区| 成人av电影免费观看| 一区二区三区欧美视频| 4438x成人网最大色成网站| 久久99精品一区二区三区三区| 久久精品人人做人人综合| av高清不卡在线| 亚洲国产成人91porn| 欧美xxxxxxxx| 成人aa视频在线观看| 亚洲精品国久久99热| 69堂成人精品免费视频| 国产在线播精品第三| 亚洲视频综合在线| 欧美疯狂做受xxxx富婆| 国产91清纯白嫩初高中在线观看| 亚洲欧美日韩久久精品| 日韩一区二区在线免费观看| 福利91精品一区二区三区| 一区二区在线看| 欧美zozozo| 欧洲亚洲精品在线| 精一区二区三区| 亚洲美女在线一区| 精品国产乱码久久久久久1区2区 | 亚洲免费看黄网站| 欧美大尺度电影在线| 9色porny自拍视频一区二区| 蜜臀a∨国产成人精品| 亚洲黄色小视频| 精品国产成人系列| 欧美日韩专区在线| 国产91露脸合集magnet | 日韩一卡二卡三卡| 99麻豆久久久国产精品免费优播| 日韩av不卡一区二区| 亚洲欧洲成人精品av97| 欧美va亚洲va| 欧美日韩一级视频| 99在线视频精品| 国产黑丝在线一区二区三区| 免费观看一级欧美片| 亚洲裸体在线观看| 中文字幕第一区二区| 日韩欧美国产一区在线观看| 欧美日韩国产小视频在线观看| 成人在线综合网站| 国产美女娇喘av呻吟久久| 一区二区在线观看不卡| 国产精品不卡一区| 久久中文娱乐网| 欧美猛男男办公室激情| 91黄色免费看| 91久久久免费一区二区| 99精品视频在线播放观看| 国产成人免费9x9x人网站视频| 久久99久久99小草精品免视看| 热久久免费视频| 亚洲mv在线观看| 亚洲成人精品一区| 亚洲一区电影777| 亚洲va在线va天堂| 亚洲综合精品自拍| 亚洲午夜在线电影| 亚洲第一激情av| 亚洲成a人片在线观看中文| 亚洲成人先锋电影| 午夜精品成人在线视频| 亚洲动漫第一页| 午夜欧美电影在线观看| 日韩精品电影在线| 免费观看在线色综合| 韩国av一区二区三区在线观看| 国精产品一区一区三区mba视频 | 精品国产一区二区三区久久影院 | 一区二区中文视频| 亚洲一区免费在线观看| 亚洲二区在线视频| 美女被吸乳得到大胸91| 国产一区啦啦啦在线观看| 成人激情图片网| 91国内精品野花午夜精品| 欧美日韩精品免费| 欧美一级日韩不卡播放免费| 2020国产精品| 最新国产成人在线观看| 亚洲成人久久影院| 国产在线播放一区三区四| av一区二区三区在线| 欧美日韩午夜在线视频| 日韩视频免费观看高清完整版| 2019国产精品| 亚洲人成7777| 久久精品免费观看| 成人黄色免费短视频| 欧美性猛交xxxxxx富婆| 日韩三级免费观看| 国产精品久线观看视频| 亚洲国产一区二区三区青草影视| 美国十次了思思久久精品导航| 成人av资源在线| 欧美日韩高清一区二区| 国产农村妇女毛片精品久久麻豆| 洋洋成人永久网站入口| 激情综合色综合久久综合| 色综合久久久久综合体| 日韩欧美国产综合| 亚洲精品成人少妇| 韩国av一区二区三区四区| 欧洲精品一区二区三区在线观看| 欧美v亚洲v综合ⅴ国产v| 亚洲激情校园春色| 国产91丝袜在线播放九色| 91精品福利在线一区二区三区| 中文字幕一区二区5566日韩| 蜜乳av一区二区| 色婷婷激情综合| 欧美国产丝袜视频| 麻豆国产精品官网| 日本韩国精品在线| 国产精品丝袜在线| 奇米四色…亚洲| 色国产综合视频| 中文久久乱码一区二区| 麻豆成人av在线| 7777精品伊人久久久大香线蕉| 亚洲视频一二区| 国产成人精品一区二区三区四区| 91精品国产手机| 亚洲影院理伦片| 91社区在线播放| 国产精品妹子av| 国产成人精品网址| 久久久久久免费毛片精品| 免费视频一区二区| 在线播放91灌醉迷j高跟美女| 亚洲啪啪综合av一区二区三区| 成人中文字幕电影| 国产丝袜欧美中文另类| 国产一区二区免费视频| 欧美一区二区播放| 日韩av网站免费在线| 欧美年轻男男videosbes| 婷婷夜色潮精品综合在线| 欧美亚洲日本一区| 一区二区三区在线影院| 色狠狠桃花综合| 亚洲国产综合91精品麻豆| 色88888久久久久久影院野外| 樱花影视一区二区| 精品视频一区二区不卡|