org.openapitools.jackson.nullable.JsonNullableDeserializers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-databind-nullable Show documentation
Show all versions of jackson-databind-nullable Show documentation
JsonNullable wrapper class and Jackson module to support fields with meaningful null values.
package org.openapitools.jackson.nullable;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.deser.Deserializers;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.fasterxml.jackson.databind.type.ReferenceType;
public class JsonNullableDeserializers extends Deserializers.Base {
@Override
public JsonDeserializer> findReferenceDeserializer(ReferenceType refType,
DeserializationConfig config, BeanDescription beanDesc,
TypeDeserializer contentTypeDeserializer, JsonDeserializer> contentDeserializer) {
return (refType.hasRawClass(JsonNullable.class)) ? new JsonNullableDeserializer(refType, null, contentTypeDeserializer,contentDeserializer) : null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy