Top Description Fields Constructors Methods
tools.jackson.core.exc

public Class InputCoercionException

extends StreamReadException
Class Inheritance
Imports
tools.jackson.core.*

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.

Field Summary

Modifier and TypeField and Description
protected final JsonToken
_inputType

Input token that represents input value that failed to coerce.

protected final Class<?>
_targetType

Target type that input value failed to coerce to.

private static final long

Constructor Summary

AccessConstructor and Description
public
InputCoercionException(JsonParser
Parser in use at the point where failure occurred
p
,
String
Exception mesage to use
msg
,
JsonToken
Shape of input that failed to coerce
inputType
,
Class<?>
Target type of failed coercion
targetType
)

Constructor that uses current parsing location as location, and sets processor (accessible via processor()) to specified parser.

Method Summary

Modifier and TypeMethod and Description
public JsonToken

Returns:

"Shape" of input for which coercion failed, as JsonToken
getInputType
()

Accessor for getting information about input type (in form of token, giving "shape" of input) for which coercion failed.

public Class<?>

Returns:

Target type of failed conversion
getTargetType
()

Accessor for getting information about target type (in form of Java java.lang.Class) for which coercion failed.

public InputCoercionException
withParser(JsonParser p)

Overrides tools.jackson.core.exc.StreamReadException.withParser.

Fluent method that may be used to assign originating JsonParser, to be accessed using processor().

Inherited from tools.jackson.core.exc.StreamReadException:
processor

Field Detail

_inputTypeback to summary
protected final JsonToken _inputType

Input token that represents input value that failed to coerce.

_targetTypeback to summary
protected final Class<?> _targetType

Target type that input value failed to coerce to.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.core.exc.StreamReadException.serialVersionUID.

Constructor Detail

InputCoercionExceptionback to summary
public InputCoercionException(JsonParser p, String msg, JsonToken inputType, Class<?> targetType)

Constructor that uses current parsing location as location, and sets processor (accessible via processor()) to specified parser.

Parameters
p:JsonParser

Parser in use at the point where failure occurred

msg:String

Exception mesage to use

inputType:JsonToken

Shape of input that failed to coerce

targetType:Class<?>

Target type of failed coercion

Method Detail

getInputTypeback to summary
public JsonToken getInputType()

Accessor for getting information about input type (in form of token, giving "shape" of input) for which coercion failed.

Returns:JsonToken

"Shape" of input for which coercion failed, as JsonToken

getTargetTypeback to summary
public Class<?> getTargetType()

Accessor for getting information about target type (in form of Java java.lang.Class) for which coercion failed.

Returns:Class<?>

Target type of failed conversion

withParserback to summary
public InputCoercionException withParser(JsonParser p)

Overrides tools.jackson.core.exc.StreamReadException.withParser.

Fluent method that may be used to assign originating JsonParser, to be accessed using processor().

Note

`this` instance is modified and no new instance is constructed.

Annotations
@Override