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

com.browserup.harreader.jackson.ExceptionIgnoringIntegerDeserializer Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
package com.browserup.harreader.jackson;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.deser.std.NumberDeserializers;

import java.io.IOException;

public class ExceptionIgnoringIntegerDeserializer extends JsonDeserializer {
    @Override
    public Integer deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
        try {
            NumberDeserializers.IntegerDeserializer integerDeserializer = new NumberDeserializers.IntegerDeserializer(Integer.class, null);
            return integerDeserializer.deserialize(jp, ctxt);
        } catch (IOException e) {
            //ignore
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy