@@ -235,6 +235,9 @@ public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type,
235
235
TypeDeserializer elementTypeDeserializer , JsonDeserializer <?> elementDeserializer )
236
236
throws JsonMappingException ;
237
237
238
+ // To be added in 3.0
239
+ // public boolean hasDeserializerFor(Class<?> valueType);
240
+
238
241
/*
239
242
/**********************************************************
240
243
/* Helper classes
@@ -248,7 +251,8 @@ public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type,
248
251
* of methods are not needed (especially enumeration and array deserializers are
249
252
* very rarely overridden).
250
253
*/
251
- public static class Base implements Deserializers
254
+ public abstract static class Base
255
+ implements Deserializers
252
256
{
253
257
@ Override
254
258
public JsonDeserializer <?> findEnumDeserializer (Class <?> type ,
@@ -266,14 +270,13 @@ public JsonDeserializer<?> findTreeNodeDeserializer(Class<? extends JsonNode> no
266
270
return null ;
267
271
}
268
272
269
- @ Override // since 2.7
273
+ @ Override
270
274
public JsonDeserializer <?> findReferenceDeserializer (ReferenceType refType ,
271
275
DeserializationConfig config , BeanDescription beanDesc ,
272
276
TypeDeserializer contentTypeDeserializer , JsonDeserializer <?> contentDeserializer )
273
- throws JsonMappingException {
274
- // 21-Oct-2015, tatu: For backwards compatibility, let's delegate to "bean" variant,
275
- // for 2.7 -- remove work-around from 2.8 or later
276
- return findBeanDeserializer (refType , config , beanDesc );
277
+ throws JsonMappingException
278
+ {
279
+ return null ;
277
280
}
278
281
279
282
@ Override
@@ -330,5 +333,24 @@ public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type,
330
333
{
331
334
return null ;
332
335
}
336
+
337
+ /**
338
+ * Method that may be called to check whether this deserializer provider would provide
339
+ * deserializer for values of given type, without attempting to construct (and possibly
340
+ * fail in some cases) actual deserializer. Mostly needed to support validation
341
+ * of polymorphic type ids.
342
+ *<p>
343
+ * Note: implementations should take care NOT to claim supporting types that they do
344
+ * not recognize as this could to incorrect assumption of safe support by caller.
345
+ *<p>
346
+ * Method added in this implementation since adding new methods for interfaces
347
+ * before Java 8 is not a good idea: will be added in Jackson 3.0 for `Deserializers`.
348
+ *
349
+ * @since 2.11
350
+ */
351
+ public boolean hasDeserializerFor (Class <?> valueType ) {
352
+ return false ;
353
+ }
354
+ // public abstract boolean hasDeserializerFor(Class<?> valueType);
333
355
}
334
356
}
0 commit comments