Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.datatype.joda.deser;
Basic deserializer for org.joda.time.ReadableDateTime and its subtypes. Accepts JSON String and Number values and passes those to single-argument constructor. Does not (yet?) support JSON object; support can be added if desired.
public class InstantDeserializer
    public InstantDeserializer() {
        throws IOExceptionJsonProcessingException
        JsonToken t = jp.getCurrentToken();
        if (t == .) {
            return new Instant(jp.getLongValue());
        if (t == .) {
            String str = jp.getText().trim();
            if (str.length() == 0) { // [JACKSON-360]
                return null;
            return new Instant(str);
        throw ctxt.mappingException(getValueClass());
New to GrepCode? Check out our FAQ X