Class InputCoercionException

  • All Implemented Interfaces:
    java.io.Serializable

    public class InputCoercionException
    extends StreamReadException
    Exception type for read-side problems that are not direct decoding ("parsing") problems (those would be reported as JsonParseExceptions), 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.
    Since:
    2.10
    See Also:
    Serialized Form
    • Field Detail

      • _inputType

        protected final JsonToken _inputType
        Input token that represents input value that failed to coerce.
      • _targetType

        protected final java.lang.Class<?> _targetType
        Target type that input value failed to coerce to.
    • Constructor Detail

      • InputCoercionException

        public 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.
    • Method Detail

      • getInputType

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

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