Class StreamWriteException

All Implemented Interfaces:
Serializable

public class StreamWriteException extends JacksonException
Intermediate base class for all write-side streaming processing problems, mostly content generation issues.
See Also:
  • Constructor Details

  • Method Details

    • withGenerator

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

      public JsonGenerator 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.