org.openapitools.jackson.nullable.JsonNullableDeserializer 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.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
import com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.fasterxml.jackson.databind.type.ReferenceType;
import java.io.IOException;
public class JsonNullableDeserializer extends ReferenceTypeDeserializer> {
private static final long serialVersionUID = 1L;
private boolean isStringDeserializer = false;
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public JsonNullableDeserializer(JavaType fullType, ValueInstantiator inst,
TypeDeserializer typeDeser, JsonDeserializer> deser) {
super(fullType, inst, typeDeser, deser);
if (fullType instanceof ReferenceType && ((ReferenceType) fullType).getReferencedType() != null) {
this.isStringDeserializer = ((ReferenceType) fullType).getReferencedType().isTypeOrSubTypeOf(String.class);
}
}
/*
/**********************************************************
/* Abstract method implementations
/**********************************************************
*/
@Override
public JsonNullable
© 2015 - 2024 Weber Informatics LLC | Privacy Policy