java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
tools.jackson.core.JacksonException
tools.jackson.core.exc.StreamReadException
tools.jackson.core.exc.InputCoercionException
- All Implemented Interfaces:
Serializable
Exception type for read-side problems that are not direct decoding ("parsing")
problems (those would be reported as basic
StreamReadExceptions),
but rather result from failed attempts to convert specific Java value out of valid
but incompatible input value. One example is numeric coercions where target number type's
range does not allow mapping of too large/too small input value.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JacksonException
JacksonException.Reference -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JsonTokenInput token that represents input value that failed to coerce.protected final Class<?>Target type that input value failed to coerce to.Fields inherited from class tools.jackson.core.JacksonException
_location, _path, _processor -
Constructor Summary
ConstructorsConstructorDescriptionInputCoercionException(JsonParser p, String msg, JsonToken inputType, Class<?> targetType) Constructor that uses current parsing location as location, and sets processor (accessible viaStreamReadException.processor()) to specified parser. -
Method Summary
Modifier and TypeMethodDescriptionAccessor for getting information about input type (in form of token, giving "shape" of input) for which coercion failed.Class<?>Accessor for getting information about target type (in form of JavaClass) for which coercion failed.Fluent method that may be used to assign originatingJsonParser, to be accessed usingStreamReadException.processor().Methods inherited from class tools.jackson.core.exc.StreamReadException
processorMethods inherited from class tools.jackson.core.JacksonException
_appendPathDesc, _appendReferenceChain, _buildMessage, _exceptionMessage, clearLocation, getLocalizedMessage, getLocation, getMessage, getOriginalMessage, getPath, getPathReference, getPathReference, messageSuffix, prependPath, prependPath, prependPath, toString, withCause, wrapWithPath, wrapWithPath, wrapWithPath, wrapWithPathMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
_inputType
Input token that represents input value that failed to coerce. -
_targetType
Target type that input value failed to coerce to.
-
-
Constructor Details
-
InputCoercionException
Constructor that uses current parsing location as location, and sets processor (accessible viaStreamReadException.processor()) to specified parser.- Parameters:
p- Parser in use at the point where failure occurredmsg- Exception mesage to useinputType- Shape of input that failed to coercetargetType- Target type of failed coercion
-
-
Method Details
-
withParser
Fluent method that may be used to assign originatingJsonParser, to be accessed usingStreamReadException.processor().NOTE: `this` instance is modified and no new instance is constructed.
- Overrides:
withParserin classStreamReadException- Parameters:
p- Parser instance to assign to this exception- Returns:
- This exception instance to allow call chaining
-
getInputType
Accessor for getting information about input type (in form of token, giving "shape" of input) for which coercion failed.- Returns:
- "Shape" of input for which coercion failed, as
JsonToken
-
getTargetType
Accessor for getting information about target type (in form of JavaClass) for which coercion failed.- Returns:
- Target type of failed conversion
-