use of com.fasterxml.jackson.annotation.JsonSetter.Nulls in project jackson-databind by FasterXML.
the class StdDeserializer method findContentNullProvider.
/**
* Method called to find {@link NullValueProvider} for a contents of a structured
* primary property (Collection, Map, array), using
* "content nulls" setting. If no provider found (not defined),
* will return given value deserializer (which is a null value provider itself).
*
* @since 2.9
*/
protected NullValueProvider findContentNullProvider(DeserializationContext ctxt, BeanProperty prop, JsonDeserializer<?> valueDeser) throws JsonMappingException {
final Nulls nulls = findContentNullStyle(ctxt, prop);
if (nulls == Nulls.SKIP) {
return NullsConstantProvider.skipper();
}
NullValueProvider prov = _findNullProvider(ctxt, prop, nulls, valueDeser);
if (prov != null) {
return prov;
}
return valueDeser;
}
use of com.fasterxml.jackson.annotation.JsonSetter.Nulls in project jackson-databind by FasterXML.
the class PrimitiveArrayDeserializers method createContextual.
@Override
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException {
Boolean unwrapSingle = findFormatFeature(ctxt, property, _valueClass, JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
NullValueProvider nuller = null;
Nulls nullStyle = findContentNullStyle(ctxt, property);
if (nullStyle == Nulls.SKIP) {
nuller = NullsConstantProvider.skipper();
} else if (nullStyle == Nulls.FAIL) {
if (property == null) {
nuller = NullsFailProvider.constructForRootValue(ctxt.constructType(_valueClass));
} else {
nuller = NullsFailProvider.constructForProperty(property);
}
}
if ((unwrapSingle == _unwrapSingle) && (nuller == _nuller)) {
return this;
}
return withResolved(nuller, unwrapSingle);
}
Aggregations