Merge pull request #739 from tomtit/revert726

Reverted JsonUtil.mustache for JavaClientCodegen after PR #726.
This commit is contained in:
Ron 2015-05-12 09:42:37 +02:00
commit 75ff9089af

View File

@ -1,17 +1,23 @@
package {{invokerPackage}}; package {{invokerPackage}};
import com.google.gson.Gson; import com.fasterxml.jackson.annotation.*;
import com.google.gson.GsonBuilder; import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.core.JsonGenerator.Feature;
import com.fasterxml.jackson.datatype.joda.*;
public class JsonUtil { public class JsonUtil {
public static GsonBuilder gsonBuilder; public static ObjectMapper mapper;
static { static {
gsonBuilder = new GsonBuilder(); mapper = new ObjectMapper();
gsonBuilder.serializeNulls(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.registerModule(new JodaModule());
} }
public static Gson getGson() { public static ObjectMapper getJsonMapper() {
return gsonBuilder.create(); return mapper;
}
} }
};