Search in sources :

Example 1 with ContextualDeserializer

use of com.fasterxml.jackson.databind.deser.ContextualDeserializer in project alien4cloud by alien4cloud.

the class JSonMapEntryArrayDeSerializer method createContextual.

@Override
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException {
    if (ConditionalEnabledHelper.isEnabled(ctxt, property)) {
        BeanDescription beanDesc = ctxt.getConfig().introspect(property.getType());
        JsonDeserializer<?> deserializer = ctxt.getFactory().createMapDeserializer(ctxt, (MapType) property.getType(), beanDesc);
        if (deserializer instanceof ContextualDeserializer) {
            deserializer = ((ContextualDeserializer) deserializer).createContextual(ctxt, property);
        }
        return new JSonMapEntryArrayDeSerializer(property.getType().getKeyType(), property.getType().getContentType(), deserializer);
    }
    BeanDescription beanDesc = ctxt.getConfig().introspect(property.getType());
    JsonDeserializer<?> deserializer = ctxt.getFactory().createMapDeserializer(ctxt, (MapType) property.getType(), beanDesc);
    if (deserializer instanceof ContextualDeserializer) {
        return ((ContextualDeserializer) deserializer).createContextual(ctxt, property);
    }
    return deserializer;
}
Also used : ContextualDeserializer(com.fasterxml.jackson.databind.deser.ContextualDeserializer) BeanDescription(com.fasterxml.jackson.databind.BeanDescription)

Aggregations

BeanDescription (com.fasterxml.jackson.databind.BeanDescription)1 ContextualDeserializer (com.fasterxml.jackson.databind.deser.ContextualDeserializer)1