Jackson Custom Serializer and Deserializer Examples

This article shows how to create a Jackson custom serializer and deserializer to parse JSON data that contains a LocalDate type. The Jackson custom serializer or deserializer is useful when we want to process a specific format that is not the default. Table of contents: 1. Setup Jackson 2. Jackson Custom Serializer for LocalDate 3. …

Read more

Jackson Java 8 date/time type `java.time.LocalDate` not supported by default

This article shows how Jackson can support the Java 8 date time APIs or JSR-310. Table of contents: 1. Download Jackson 2. Jackson does not support Java 8 date time APIs 3. Make Jackson support Java 8 date time APIs or JSR310 3.1 jackson-datatype-jsr310 3.1 Register JavaTimeModule() 4. Download Source Code 5. References P.S Tested …

Read more

Spring Boot + Spring Data JPA + Java 8 date and time (JSR310)

In Spring Boot + Spring Data JPA application, to support the JSR310 java.time.* APIs, we need to register this Jsr310JpaConverters manually. import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters; @EntityScan( basePackageClasses = {Application.class, Jsr310JpaConverters.class} ) @SpringBootApplication public class Application { //… } P.S Tested with Spring Boot 1.5.1.RELEASE, Spring Data JPA 1.11.0.RELEASE 1. Full Example 1.1 A model contains …

Read more