Class StreamWriteException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JsonGenerationException

public abstract class StreamWriteException extends JsonProcessingException
Intermediate base class for all read-side streaming processing problems, including parsing and input value coercion problems.

Added in 2.13 to eventually replace JsonGenerationException.

Since:
2.13
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • withGenerator

      public abstract StreamWriteException withGenerator(JsonGenerator g)
      Fluent method that may be used to assign originating JsonGenerator, to be accessed using getProcessor().
      Parameters:
      g - Generator to assign
      Returns:
      This exception instance (to allow call chaining)
    • getProcessor

      public JsonGenerator getProcessor()
      Description copied from class: JsonProcessingException
      Method that allows accessing underlying processor that triggered this exception; typically either JsonParser or JsonGenerator for exceptions that originate from streaming API. Note that it is possible that `null` may be returned if code throwing exception either has no access to 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.
      Overrides:
      getProcessor in class JsonProcessingException
      Returns:
      Originating processor, if available; null if not.