From 68245442f201f8bcfbb075fecc66a6c06b236ea9 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sat, 21 May 2016 18:08:41 -0700 Subject: Yet more work for #1207; added `DeserializationProblemHandler.handleMissingInstantiator()` (and supporting functionality), to replace `instantiationException(Class, String)` --- .../deser/DeserializationProblemHandler.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java') diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java index 3069cce2e..a1de632d1 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java @@ -206,6 +206,39 @@ public abstract class DeserializationProblemHandler return NOT_HANDLED; } + /** + * Method called when instance creation for a type fails due to lack of an + * instantiator. Method is called before actual deserialization from input + * is attempted, so handler may do one of following things: + * + * + * @param instClass Type that was to be instantiated + * @param p Parser to use for accessing content that needs handling, to either + * use it or skip it (latter with {@link JsonParser#skipChildren()}. + * + * @return Either {@link #NOT_HANDLED} to indicate that handler does not know + * what to do (and exception may be thrown), or value to use as key (possibly + * null + * + * @since 2.8 + */ + public Object handleMissingInstantiator(DeserializationContext ctxt, + Class instClass, JsonParser p, String msg) + throws IOException + { + return NOT_HANDLED; + } + /** * Handler method called if resolution of type id from given String failed * to produce a subtype; usually because logical id is not mapped to actual -- cgit v1.2.3