public class InputCoercionException extends StreamReadException
JsonParseException
s),
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.Modifier and Type | Field and Description |
---|---|
protected JsonToken |
_inputType
Input token that represents input value that failed to coerce.
|
protected Class<?> |
_targetType
Target type that input value failed to coerce to.
|
_processor, _requestPayload
_location
Constructor and Description |
---|
InputCoercionException(JsonParser p,
String msg,
JsonToken inputType,
Class<?> targetType)
Constructor that uses current parsing location as location, and
sets processor (accessible via
StreamReadException.getProcessor() ) to
specified parser. |
Modifier and Type | Method and Description |
---|---|
JsonToken |
getInputType()
Accessor for getting information about input type (in form of token, giving "shape"
of input) for which coercion failed.
|
Class<?> |
getTargetType()
Accessor for getting information about target type (in form of Java
Class )
for which coercion failed. |
InputCoercionException |
withParser(JsonParser p)
Fluent method that may be used to assign originating
JsonParser ,
to be accessed using StreamReadException.getProcessor() . |
InputCoercionException |
withRequestPayload(RequestPayload p)
Fluent method that may be used to assign payload to this exception,
to let recipient access it for diagnostics purposes.
|
_currentLocation, getMessage, getProcessor, getRequestPayload, getRequestPayloadAsString
clearLocation, getLocation, getMessageSuffix, getOriginalMessage, toString
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
protected final JsonToken _inputType
protected final Class<?> _targetType
public InputCoercionException(JsonParser p, String msg, JsonToken inputType, Class<?> targetType)
StreamReadException.getProcessor()
) to
specified parser.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 coercionpublic InputCoercionException withParser(JsonParser p)
JsonParser
,
to be accessed using StreamReadException.getProcessor()
.
NOTE: `this` instance is modified and no new instance is constructed.
withParser
in class StreamReadException
p
- Parser instance to assign to this exceptionpublic InputCoercionException withRequestPayload(RequestPayload p)
StreamReadException
NOTE: `this` instance is modified and no new instance is constructed.
withRequestPayload
in class StreamReadException
p
- Payload to assign to this exceptionpublic JsonToken getInputType()
JsonToken
Copyright © 2008–2024 FasterXML. All rights reserved.