de.sstoehr.harreader.jackson.ExceptionIgnoringIntegerDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of har-reader Show documentation
Show all versions of har-reader Show documentation
A library to access HTTP archive format with Java
package de.sstoehr.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;
}
}