Is there a standard implementation for a GSON Joda Time serialiser?

I’ve decided to roll my own open source one – you can find it here:

https://github.com/gkopff/gson-jodatime-serialisers

Here’s the Maven details (check central for the latest version):

<dependency>
  <groupId>com.fatboyindustrial.gson-jodatime-serialisers</groupId>
  <artifactId>gson-jodatime-serialisers</artifactId>
  <version>1.6.0</version>
</dependency>

And here’s a quick example of how you drive it:

Gson gson = Converters.registerDateTime(new GsonBuilder()).create();
SomeContainerObject original = new SomeContainerObject(new DateTime());

String json = gson.toJson(original);
SomeContainerObject reconstituted = gson.fromJson(json, SomeContainerObject.class);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)