2

In MobileFirst Foundation 8.0, are there any hook points to add a custom JSON serialization for Java datatypes in Java adapters?

For example: Using a Date object in a pojo class, this gets serialized to a default format "2016-09-27T12:11:17.430Z". I need to serialize this only to show the date value, stripping off time related information.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89

1 Answers1

0

Have you looked at the @JsonFormat JAX-RS annotation? From its description:

General-purpose annotation used for configuring details of how values of properties are to be serialized. Unlike most other Jackson annotations, annotation does not have specific universal interpretation: instead, effect depends on datatype of property being annotated (or more specifically, deserializer and serializer being used).

Java adapters are essentially JAX-RS applications and you can add annotations...

Idan Adar
  • 44,156
  • 13
  • 50
  • 89