This is an automated email from the ASF dual-hosted git repository. carlosrovira pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push: new eab9ac2 example passing a "flex.messaging.io.ArrayCollection" to "org.apache.royale.collections.ArrayList", so "mx.collections.ArrayCollection" is finally not needed. eab9ac2 is described below commit eab9ac2121fec9a3f9588f3ec102ec5e80a2d981 Author: Carlos Rovira <carlosrov...@apache.org> AuthorDate: Tue May 15 23:25:25 2018 +0200 example passing a "flex.messaging.io.ArrayCollection" to "org.apache.royale.collections.ArrayList", so "mx.collections.ArrayCollection" is finally not needed. --- .../royale/amfsamples/services/ExampleService.java | 12 +++++++++++ .../royale/amfsamples/valueobjects/Product.java | 24 +++++++++++++++++++++- .../RemoteObjectAMFTest/src/main/royale/App.mxml | 11 +++++++++- .../src/main/royale/valueObjects/Product.as | 15 ++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java index 2049693..5582881 100644 --- a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java +++ b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java @@ -28,6 +28,9 @@ import org.springframework.stereotype.Service; import java.util.List; import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.HashSet; @Service("exampleService") @RemotingDestination @@ -109,6 +112,15 @@ public class ExampleService { } product.setZones(zones); + + List<CharSequence> list = new ArrayList<CharSequence>(); + list.add("A"); + list.add("B"); + list.add("A"); + list.add("C"); + list.add("C"); + list.add("B"); + product.setFlavors(new HashSet<CharSequence>(list)); return product; } diff --git a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java index 7701108..81957a1 100644 --- a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java +++ b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java @@ -17,6 +17,7 @@ package org.apache.royale.amfsamples.valueobjects; import java.util.Collection; +import java.util.Set; /** * The server side object used by AMFConnectionTestService. There is a @@ -72,12 +73,33 @@ public class Product /** * The zones list. * - * @param zoness The zones list. + * @param zones The zones list. */ public void setZones(Object[] zones) { this.zones = zones; } + private Set<CharSequence> flavors = null; + + /** + * The flavors set of names. + * + * @return The flavors set of names. + */ + public Set<CharSequence> getFlavors() { + return flavors; + } + + /** + * The flavors set of names. + * + * @param flavors The flavors set of names. + */ + public void setFlavors(Set<CharSequence> flavors) { + this.flavors = flavors; + } + + public String toString() { return "Product -> name: " + name + ", description: " + description; diff --git a/examples/royale/RemoteObjectAMFTest/src/main/royale/App.mxml b/examples/royale/RemoteObjectAMFTest/src/main/royale/App.mxml index 1a97d8d..77943bc 100644 --- a/examples/royale/RemoteObjectAMFTest/src/main/royale/App.mxml +++ b/examples/royale/RemoteObjectAMFTest/src/main/royale/App.mxml @@ -62,11 +62,20 @@ limitations under the License. received3.text = "Received: product name is '" + product.name + "', product description is '" + product.description + "'. product taxonomy type is '" + product.taxonomy.type + "' and product taxonomy description is '" + product.taxonomy.description + "' zones: " ; var len:int = product.zones.length; - for(var index:int = 0; index < len; index++) + var index:int; + for(index = 0; index < len; index++) { zone = product.zones[index]; received3.text += "[" + zone.id + ", " + zone.name + "], "; } + + received3.text += " flavors: "; + + len = product.flavors.length; + for(index = 0; index < len; index++) + { + received3.text += "[" + product.flavors[index] + "], "; + } } else { var arr:ArrayList = new ArrayList(evt.data as Array); diff --git a/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as b/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as index 6bde660..1210986 100644 --- a/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as +++ b/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as @@ -18,6 +18,8 @@ //////////////////////////////////////////////////////////////////////////////// package valueObjects { + import org.apache.royale.collections.ArrayList; + //import org.apache.royale.collections.ArrayList; [RemoteClass(alias="org.apache.royale.amfsamples.valueobjects.Product")] @@ -75,5 +77,18 @@ package valueObjects { _zones = value; } + + private var _flavors:ArrayList = null; + + public function get flavors():ArrayList + { + return _flavors; + } + + public function set flavors(value:ArrayList):void + { + _flavors = value; + } + } } -- To stop receiving notification emails like this one, please contact carlosrov...@apache.org.