Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.datatype.joda;
 
 import org.joda.time.*;
 
 
public class JodaModule extends SimpleModule
    /*
    /**********************************************************
    /* Life-cycle
    /**********************************************************
     */
    
    public JodaModule()
    {
        super(..version());
        addDeserializer(LocalDate.classnew LocalDateDeserializer());
        addDeserializer(Period.classnew PeriodDeserializer());
        addDeserializer(DateTime.class, DateTimeDeserializer.forType(DateTime.class));
        addDeserializer(ReadableDateTime.class, DateTimeDeserializer.forType(ReadableDateTime.class));
        addDeserializer(ReadableInstant.class, DateTimeDeserializer.forType(ReadableInstant.class));
        
        // then serializers:
        addSerializer(DateTime.classnew DateTimeSerializer());
        addSerializer(LocalDateTime.classnew LocalDateTimeSerializer());
        addSerializer(LocalDate.classnew LocalDateSerializer());
        addSerializer(DateMidnight.classnew DateMidnightSerializer());
    }
New to GrepCode? Check out our FAQ X