Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0B79010BE3 for ; Mon, 24 Feb 2014 00:22:05 +0000 (UTC) Received: (qmail 75759 invoked by uid 500); 24 Feb 2014 00:22:04 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 75680 invoked by uid 500); 24 Feb 2014 00:22:04 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 75674 invoked by uid 99); 24 Feb 2014 00:22:04 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2014 00:22:04 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DB1F489E26B; Mon, 24 Feb 2014 00:22:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jmclean@apache.org To: commits@flex.apache.org Message-Id: <7e1d0ed2a287406fbbbef9d3d5e4e340@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [flex-sdk] [refs/heads/develop] - FLEX-34108 add toJSON to ArrayCollection and ArrayList Date: Mon, 24 Feb 2014 00:22:03 +0000 (UTC) Repository: flex-sdk Updated Branches: refs/heads/develop 6942969e4 -> 4cec69c5a FLEX-34108 add toJSON to ArrayCollection and ArrayList Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/4cec69c5 Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/4cec69c5 Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/4cec69c5 Branch: refs/heads/develop Commit: 4cec69c5a6d846c12bd52e08aa2dcdc416b7911d Parents: 6942969 Author: Justin Mclean Authored: Mon Feb 24 11:21:43 2014 +1100 Committer: Justin Mclean Committed: Mon Feb 24 11:21:43 2014 +1100 ---------------------------------------------------------------------- .../framework/src/mx/collections/ArrayCollection.as | 16 +++++++++++++++- .../framework/src/mx/collections/ArrayList.as | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4cec69c5/frameworks/projects/framework/src/mx/collections/ArrayCollection.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/collections/ArrayCollection.as b/frameworks/projects/framework/src/mx/collections/ArrayCollection.as index 850317b..9d6f18d 100644 --- a/frameworks/projects/framework/src/mx/collections/ArrayCollection.as +++ b/frameworks/projects/framework/src/mx/collections/ArrayCollection.as @@ -105,7 +105,7 @@ public class ArrayCollection extends ListCollectionView implements IExternalizab // Properties // //-------------------------------------------------------------------------- - + //---------------------------------- // source //---------------------------------- @@ -147,6 +147,20 @@ public class ArrayCollection extends ListCollectionView implements IExternalizab // //-------------------------------------------------------------------------- + /** + * Converts an Array Collection to JavaScript Object Notation (JSON) format. + * + * @langversion 3.0 + * @playerversion Flash 11 + * @playerversion AIR 3.0 + * @productversion Apache Flex 4.12 + */ + public function toJSON(s:String):* + { + var array:Array = toArray(); + return JSON.stringify(array); + } + /** * @private * Ensures that only the source property is serialized. http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4cec69c5/frameworks/projects/framework/src/mx/collections/ArrayList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/collections/ArrayList.as b/frameworks/projects/framework/src/mx/collections/ArrayList.as index 1afa845..abdb09b 100644 --- a/frameworks/projects/framework/src/mx/collections/ArrayList.as +++ b/frameworks/projects/framework/src/mx/collections/ArrayList.as @@ -271,6 +271,20 @@ public class ArrayList extends EventDispatcher // //-------------------------------------------------------------------------- + /** + * Converts an Array Collection to JavaScript Object Notation (JSON) format. + * + * @langversion 3.0 + * @playerversion Flash 11 + * @playerversion AIR 3.0 + * @productversion Apache Flex 4.12 + */ + public function toJSON(s:String):* + { + var array:Array = toArray(); + return JSON.stringify(array); + } + /** * Get the item at the specified index. *