Package com.fasterxml.jackson.core.exc
Class StreamWriteException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- com.fasterxml.jackson.core.JacksonException
-
- com.fasterxml.jackson.core.JsonProcessingException
-
- com.fasterxml.jackson.core.exc.StreamWriteException
-
- All Implemented Interfaces:
java.io.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:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description JsonGenerator
getProcessor()
Method that allows accessing underlying processor that triggered this exception; typically eitherJsonParser
orJsonGenerator
for exceptions that originate from streaming API.abstract StreamWriteException
withGenerator(JsonGenerator g)
Fluent method that may be used to assign originatingJsonGenerator
, to be accessed usinggetProcessor()
.-
Methods inherited from class com.fasterxml.jackson.core.JsonProcessingException
clearLocation, getLocation, getMessage, getOriginalMessage, toString
-
-
-
-
Method Detail
-
withGenerator
public abstract StreamWriteException withGenerator(JsonGenerator g)
Fluent method that may be used to assign originatingJsonGenerator
, to be accessed usinggetProcessor()
.- 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 eitherJsonParser
orJsonGenerator
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 classJsonProcessingException
- Returns:
- Originating processor, if available; null if not.
-
-