Top Fields Constructors Methods
com.fasterxml.jackson.module.noctordeser

public Class MissingInstantiatorHandler

extends DeserializationProblemHandler
Class Inheritance
Imports
com.fasterxml.jackson.core.JacksonException, .JsonParser, com.fasterxml.jackson.databind.DeserializationContext, .JsonDeserializer, com.fasterxml.jackson.databind.deser.DeserializationProblemHandler, .ValueInstantiator, com.fasterxml.jackson.module.noctordeser.util.ReflectionUtil, java.io.IOException

Field Summary

Modifier and TypeField and Description
private final ReflectionUtil
Inherited from com.fasterxml.jackson.databind.deser.DeserializationProblemHandler:
NOT_HANDLED

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
handleMissingInstantiator(DeserializationContext ctxt, Class<?>
Type that was to be instantiated
instClass
,
ValueInstantiator valueInst, JsonParser
Parser to use for accessing content that needs handling, to either use it or skip it (latter with JsonParser#skipChildren().
jsonParser
,
String msg)

Overrides com.fasterxml.jackson.databind.deser.DeserializationProblemHandler.handleMissingInstantiator.

Method called when instance creation for a type fails due to lack of an instantiator.

Inherited from com.fasterxml.jackson.databind.deser.DeserializationProblemHandler:
handleInstantiationProblemhandleMissingInstantiatorhandleMissingTypeIdhandleUnexpectedTokenhandleUnexpectedTokenhandleUnknownPropertyhandleUnknownTypeIdhandleWeirdKeyhandleWeirdNativeValuehandleWeirdNumberValuehandleWeirdStringValue

Field Detail

_utilback to summary
private final ReflectionUtil _util

Constructor Detail

MissingInstantiatorHandlerback to summary
public MissingInstantiatorHandler()

Method Detail

handleMissingInstantiatorback to summary
public Object handleMissingInstantiator(DeserializationContext ctxt, Class<?> instClass, ValueInstantiator valueInst, JsonParser jsonParser, String msg) throws IOException, JacksonException

Overrides com.fasterxml.jackson.databind.deser.DeserializationProblemHandler.handleMissingInstantiator.

Doc from com.fasterxml.jackson.databind.deser.DeserializationProblemHandler.handleMissingInstantiator.

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:

  • Indicate it does not know what to do by returning NOT_HANDLED
  • Throw a IOException to indicate specific fail message (instead of standard exception caller would throw
  • Handle content to match (by consuming or skipping it), and return actual instantiated value (of type targetType) to use as replacement; value may be `null` as well as expected target type.
Parameters
instClass:Class<?>

Type that was to be instantiated

jsonParser:JsonParser

Parser to use for accessing content that needs handling, to either use it or skip it (latter with JsonParser#skipChildren().

Returns:Object

Either NOT_HANDLED to indicate that handler does not know what to do (and exception may be thrown), or value to use (possibly null

Annotations
@Override