aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2012-02-08 09:37:18 +0000
committerManolo Carrasco <manolo@apache.org>2012-02-08 09:37:18 +0000
commit2067020f9c6a808362ea14f76beb4ed9973fa0af (patch)
treea42279b440c42787d9d27a67cb1b442da09f8ecd
parentfc5ca690a618c7506997c654b4360ce74a557bef (diff)
downloadgwtquery-2067020f9c6a808362ea14f76beb4ed9973fa0af.tar.gz
gwtquery-2067020f9c6a808362ea14f76beb4ed9973fa0af.zip
deal with enum values
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java
index ea358f90..3fcb79bf 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java
@@ -44,10 +44,8 @@ public class JsonBuilderGenerator extends Generator {
static JClassType jsonBuilderType;
static JClassType stringType;
static JClassType jsType;
- static JClassType listType;
+ static JClassType listType;
static JClassType functionType;
- static JClassType enumType;
-
public String generate(TreeLogger treeLogger,
GeneratorContext generatorContext, String requestedClass)
@@ -57,9 +55,8 @@ public class JsonBuilderGenerator extends Generator {
jsonBuilderType = oracle.findType(JsonBuilder.class.getName());
stringType = oracle.findType(String.class.getName());
jsType = oracle.findType(JavaScriptObject.class.getName());
- listType = oracle.findType(List.class.getName());
+ listType = oracle.findType(List.class.getName());
functionType = oracle.findType(Function.class.getName());
- enumType = oracle.findType(Enum.class.getName());
String t[] = generateClassName(clazz);
@@ -156,10 +153,9 @@ public class JsonBuilderGenerator extends Generator {
sw.println("return " + ret + ";");
} else {
sw.println("return Arrays.asList(" + ret + ");");
- }
- } else if (isTypeAssignableTo(method.getReturnType(), enumType)){
- sw.println("return "+method.getReturnType().getQualifiedSourceName()+".valueOf(p.getStr(\"" + name + "\"));");
- }else {
+ }
+
+ } else {
sw.println("System.err.println(\"JsonBuilderGenerator WARN: unknown return type "
+ retType + " " + ifaceName + "." + methName + "()\"); ");
// We return the object because probably the user knows how to handle it