All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.onetwo.common.jackson.JsonDateOnlyDerializer Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version
package org.onetwo.common.jackson;

import java.io.IOException;
import java.util.Date;

import org.onetwo.common.date.NiceDate;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

public class JsonDateOnlyDerializer extends JsonDeserializer{

	@Override
	public Date deserialize(JsonParser p, DeserializationContext ctxt)throws IOException, JsonProcessingException {
		String val = p.getText();
		return NiceDate.New(val).thisDate().getTime();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy