static JClassType jsType;\r
static JClassType listType;\r
static JClassType functionType;\r
+ static JClassType enumType;\r
+\r
\r
public String generate(TreeLogger treeLogger,\r
GeneratorContext generatorContext, String requestedClass)\r
jsType = oracle.findType(JavaScriptObject.class.getName());\r
listType = oracle.findType(List.class.getName());\r
functionType = oracle.findType(Function.class.getName());\r
+ enumType = oracle.findType(Enum.class.getName());\r
\r
String t[] = generateClassName(clazz);\r
\r
} else {\r
sw.println("return Arrays.asList(" + ret + ");");\r
}\r
- \r
- } else {\r
+ } else if (isTypeAssignableTo(method.getReturnType(), enumType)){ \r
+ sw.println("return "+method.getReturnType().getQualifiedSourceName()+".valueOf(p.getStr(\"" + name + "\"));");\r
+ }else {\r
sw.println("System.err.println(\"JsonBuilderGenerator WARN: unknown return type " \r
+ retType + " " + ifaceName + "." + methName + "()\"); ");\r
// We return the object because probably the user knows how to handle it\r