/** * Convenience method, functionally same as: * * <pre> * getDeserializerProvider().findKeyDeserializer(getConfig(), propertyType, property); * </pre> */ public final KeyDeserializer findKeyDeserializer(JavaType keyType, BeanProperty property) throws JsonMappingException { KeyDeserializer kd = _cache.findKeyDeserializer(this, _factory, keyType); // Second: contextualize? if (kd instanceof ContextualKeyDeserializer) { kd = ((ContextualKeyDeserializer) kd).createContextual(this, property); } return kd; }
/** * Method for finding a value deserializer, and creating a contextual version if necessary, for * value reached via specified property. */ @SuppressWarnings("unchecked") public final JsonDeserializer<Object> findContextualValueDeserializer( JavaType type, BeanProperty property) throws JsonMappingException { JsonDeserializer<Object> deser = _cache.findValueDeserializer(this, _factory, type); if (deser != null) { if (deser instanceof ContextualDeserializer) { deser = (JsonDeserializer<Object>) ((ContextualDeserializer) deser).createContextual(this, property); } } return deser; }
/** Method for finding a deserializer for root-level value. */ @SuppressWarnings("unchecked") public final JsonDeserializer<Object> findRootValueDeserializer(JavaType type) throws JsonMappingException { JsonDeserializer<Object> deser = _cache.findValueDeserializer(this, _factory, type); if (deser == null) { // can this occur? return null; } if (deser instanceof ContextualDeserializer) { deser = (JsonDeserializer<Object>) ((ContextualDeserializer) deser).createContextual(this, null); } TypeDeserializer typeDeser = _factory.findTypeDeserializer(_config, type); if (typeDeser != null) { // important: contextualize to indicate this is for root value typeDeser = typeDeser.forProperty(null); return new TypeWrappedDeserializer(typeDeser, deser); } return deser; }
/** Method for checking whether we could find a deserializer for given type. */ public boolean hasValueDeserializerFor(JavaType type) { return _cache.hasValueDeserializerFor(this, _factory, type); }