diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-01 22:51:30 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-01 22:51:30 (GMT) |
commit | 945160d0539ad119ffc986fac712db76c7203e84 (patch) | |
tree | c43e4a7db898026bc62cc20af5061d07736f847e /embedding/java/src/org/uscxml/datamodel/ecmascript/ECMAEvent.java | |
parent | c70d02010ea99e6c8e35da3b767f41f1ee5dce56 (diff) | |
download | uscxml-945160d0539ad119ffc986fac712db76c7203e84.zip uscxml-945160d0539ad119ffc986fac712db76c7203e84.tar.gz uscxml-945160d0539ad119ffc986fac712db76c7203e84.tar.bz2 |
More polishing for bindings C# and Java
Diffstat (limited to 'embedding/java/src/org/uscxml/datamodel/ecmascript/ECMAEvent.java')
-rw-r--r-- | embedding/java/src/org/uscxml/datamodel/ecmascript/ECMAEvent.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/embedding/java/src/org/uscxml/datamodel/ecmascript/ECMAEvent.java b/embedding/java/src/org/uscxml/datamodel/ecmascript/ECMAEvent.java index 58fff72..45d93b8 100644 --- a/embedding/java/src/org/uscxml/datamodel/ecmascript/ECMAEvent.java +++ b/embedding/java/src/org/uscxml/datamodel/ecmascript/ECMAEvent.java @@ -1,13 +1,12 @@ package org.uscxml.datamodel.ecmascript; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.mozilla.javascript.Scriptable; import org.uscxml.Data; import org.uscxml.Event; -import org.uscxml.ParamPair; -import org.uscxml.ParamPairVector; public class ECMAEvent implements Scriptable { @@ -19,17 +18,17 @@ public class ECMAEvent implements Scriptable { public ECMAEvent(Event event) { this.event = event; - - Data data = new Data(event.getData()); - - // insert params into event.data - ParamPairVector ppv = event.getParamPairs(); - for (int i = 0; i < ppv.size(); i++) { - ParamPair pp = ppv.get(i); - data.compound.put(pp.getFirst(), new Data(pp.getSecond())); + + // copy event params to data + Data data = event.getData(); + Map<String, List<Data>> params = event.getParams(); + for (String key : params.keySet()) { + for (Data param : params.get(key)) { + data.put(key, param); + } } - members.put("type", event.getEventType().toString()); + members.put("type", event.getEventType()); members.put("data", new ECMAData(data)); members.put("sendid", event.getSendId()); members.put("origin", event.getOrigin()); |