+ ApplicationConnection.class.getName() + " connection) {");
sourceWriter.indent();
- writeBeanDeserializer(logger, sourceWriter, beanType, true);
+ writeBeanDeserializer(logger, sourceWriter, beanType);
sourceWriter.outdent();
sourceWriter.println("}");
if (isEnum) {
writeEnumDeserializer(logger, sourceWriter, beanType.isEnum());
} else {
- writeBeanDeserializer(logger, sourceWriter, beanType, false);
+ sourceWriter.println(beanQualifiedSourceName
+ + " target = GWT.create(" + beanQualifiedSourceName
+ + ".class);");
+ sourceWriter
+ .println("update(target, type, jsonValue, connection);");
+ // return target;
+ sourceWriter.println("return target;");
}
- sourceWriter.println("}");
sourceWriter.outdent();
+ sourceWriter.println("}");
// End of class
- sourceWriter.println("}");
sourceWriter.outdent();
+ sourceWriter.println("}");
// commit generated class
context.commit(logger, printWriter);
}
private void writeBeanDeserializer(TreeLogger logger,
- SourceWriter sourceWriter, JClassType beanType, boolean update) {
+ SourceWriter sourceWriter, JClassType beanType) {
String beanQualifiedSourceName = beanType.getQualifiedSourceName();
- if (!update) {
- sourceWriter.println(beanQualifiedSourceName
- + " target = GWT.create(" + beanQualifiedSourceName
- + ".class);");
- }
-
// JSONOBject json = (JSONObject)jsonValue;
sourceWriter.println(JSONObject.class.getName() + " json = ("
+ JSONObject.class.getName() + ")jsonValue;");
sourceWriter.outdent();
sourceWriter.println("}");
}
-
- if (!update) {
- // return target;
- sourceWriter.println("return target;");
- }
-
}
private void writeEnumSerializer(TreeLogger logger,