Code example for JsonPrimitive

0
 
	private static class DateTimeTypeConverter implements 
			JsonSerializer<DateTime>, JsonDeserializer<DateTime> {
		public JsonElement serialize(DateTime src, Type srcType,
				JsonSerializationContext context) {
			return new JsonPrimitive(src.toString());
		} 
 
		public DateTime deserialize(JsonElement json, Type type,
				JsonDeserializationContext context) throws JsonParseException {
			return new DateTime(json.getAsString());
		} 
	} 
}