summaryrefslogtreecommitdiffstats
path: root/client-compiler/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-01-10 12:56:52 +0200
committerVaadin Code Review <review@vaadin.com>2015-01-12 08:46:08 +0000
commit35d91245de3218283c8f4c733a3aa72ea395fb1c (patch)
tree7b4fb520d6a733403ed9a335d0442a64cf646be6 /client-compiler/src
parent28dbd0c0dad3491d1f4d405e753075df983ecacc (diff)
downloadvaadin-framework-35d91245de3218283c8f4c733a3aa72ea395fb1c.tar.gz
vaadin-framework-35d91245de3218283c8f4c733a3aa72ea395fb1c.zip
Support JsonValue types as declared types in state and RPC (#15560)
Change-Id: I2779a533811bb1b60c4e74789f6378574bc6ac61
Diffstat (limited to 'client-compiler/src')
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
index 13bd7051f6..f946d87638 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
@@ -47,6 +47,7 @@ import com.google.gwt.user.rebind.SourceWriter;
import com.vaadin.client.JsArrayObject;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.annotations.OnStateChange;
+import com.vaadin.client.communication.JsonDecoder;
import com.vaadin.client.metadata.ConnectorBundleLoader;
import com.vaadin.client.metadata.ConnectorBundleLoader.CValUiInfo;
import com.vaadin.client.metadata.InvokationHandler;
@@ -1011,7 +1012,16 @@ public class ConnectorBundleLoaderFactory extends Generator {
w.print(", ");
}
String parameterTypeName = getBoxedTypeName(parameterType);
- w.print("(" + parameterTypeName + ") params[" + i + "]");
+
+ if (parameterTypeName.startsWith("elemental.json.Json")) {
+ // Need to pass through native method to allow casting Object to
+ // JSO if the value is a string
+ w.print("%s.<%s>obj2jso(params[%d])",
+ JsonDecoder.class.getCanonicalName(),
+ parameterTypeName, i);
+ } else {
+ w.print("(" + parameterTypeName + ") params[" + i + "]");
+ }
}
w.println(");");