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.Constructor and Description |
---|
InputCoercionException(JsonParser p,
java.lang.String msg,
JsonToken inputType,
java.lang.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.
|
java.lang.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.
|
getMessage, getProcessor, getRequestPayload, getRequestPayloadAsString
clearLocation, getLocation, getOriginalMessage, toString
public InputCoercionException(JsonParser p, java.lang.String msg, JsonToken inputType, java.lang.Class<?> targetType)
StreamReadException.getProcessor()
) to
specified parser.public 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
public InputCoercionException withRequestPayload(RequestPayload p)
StreamReadException
NOTE: `this` instance is modified and no new instance is constructed.
withRequestPayload
in class StreamReadException
public JsonToken getInputType()
public java.lang.Class<?> getTargetType()
Class
)
for which coercion failed.Copyright © 2010 - 2020 Adobe. All Rights Reserved