Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.exc

public Class MismatchedInputException

extends JsonMappingException
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.databind.exc.PropertyBindingException, com.fasterxml.jackson.databind.exc.InvalidFormatException, com.fasterxml.jackson.databind.exc.InvalidNullException, com.fasterxml.jackson.databind.exc.InvalidTypeIdException
Annotations
@SuppressWarnings:serial
Imports
com.fasterxml.jackson.core.JsonLocation, .JsonParser, com.fasterxml.jackson.databind.JavaType, .JsonMappingException, com.fasterxml.jackson.databind.util.ClassUtil

General exception type used as the base class for all JsonMappingExceptions that are due to input not mapping to target definition; these are typically considered "client errors" since target type definition itself is not the root cause but mismatching input. This is in contrast to InvalidDefinitionException which signals a problem with target type definition and not input.

This type is used as-is for some input problems, but in most cases there should be more explicit subtypes to use.

Note

name chosen to differ from `java.util.InputMismatchException` since while that would have been better name, use of same overlapping name causes nasty issues with IDE auto-completion, so slightly less optimal chosen.

Since
2.9

Field Summary

Modifier and TypeField and Description
protected Class<?>
_targetType

Type of value that was to be deserialized

Inherited from com.fasterxml.jackson.databind.JsonMappingException:
_path_processor

Constructor Summary

AccessConstructor and Description
protected
protected
protected
protected

Method Summary

Modifier and TypeMethod and Description
public static MismatchedInputException
public static MismatchedInputException
from(JsonParser p, JavaType targetType, String msg)

public static MismatchedInputException
from(JsonParser p, Class<?> targetType, String msg)

public Class<?>
getTargetType()

Accessor for getting intended target type, with which input did not match, if known; `null` if not known for some reason.

public MismatchedInputException
Inherited from com.fasterxml.jackson.databind.JsonMappingException:
_appendPathDesc_buildMessagefromfromfromfromfromfromfromfromUnexpectedIOEgetLocalizedMessagegetMessagegetPathgetPathReferencegetPathReferencegetProcessorprependPathprependPathprependPathtoStringwithCausewrapWithPathwrapWithPathwrapWithPath

Field Detail

_targetTypeback to summary
protected Class<?> _targetType

Type of value that was to be deserialized

Constructor Detail

MismatchedInputExceptionback to summary
protected MismatchedInputException(JsonParser p, String msg)
MismatchedInputExceptionback to summary
protected MismatchedInputException(JsonParser p, String msg, JsonLocation loc)
MismatchedInputExceptionback to summary
protected MismatchedInputException(JsonParser p, String msg, Class<?> targetType)
MismatchedInputExceptionback to summary
protected MismatchedInputException(JsonParser p, String msg, JavaType targetType)

Method Detail

fromback to summary
public static MismatchedInputException from(JsonParser p, String msg)

Hides com.fasterxml.jackson.databind.JsonMappingException.from.

Deprecated

Annotations
@Deprecated
fromback to summary
public static MismatchedInputException from(JsonParser p, JavaType targetType, String msg)
fromback to summary
public static MismatchedInputException from(JsonParser p, Class<?> targetType, String msg)
getTargetTypeback to summary
public Class<?> getTargetType()

Accessor for getting intended target type, with which input did not match, if known; `null` if not known for some reason.

setTargetTypeback to summary
public MismatchedInputException setTargetType(JavaType t)