Class StreamReadException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InputCoercionException, UnexpectedEndOfInputException

public class StreamReadException extends JacksonException
Intermediate base class for all read-side streaming processing problems, including parsing and input value coercion problems.
See Also:
  • Constructor Details

  • Method Details

    • withParser

      public StreamReadException withParser(JsonParser p)
      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.

      Parameters:
      p - Parser instance to assign to this exception
      Returns:
      This exception instance to allow call chaining
    • processor

      public JsonParser processor()
      Description copied from class: JacksonException
      Method that allows accessing underlying processor that triggered this exception; typically either JsonParser or JsonGenerator for exceptions that originate from streaming API, but may be other types when thrown by databinding.

      Note that it is possible that null may be returned if code throwing exception either has no access to the processor; or has not been retrofitted to set it; this means that caller needs to take care to check for nulls. Subtypes override this method with co-variant return type, for more type-safe access.

      NOTE: In Jackson 2.x, accessor was getProcessor(): in 3.0 changed to non-getter to avoid having to annotate for serialization.

      Overrides:
      processor in class JacksonException
      Returns:
      Originating processor, if available; null if not.