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:
Serializable
- Direct Known Subclasses:
JsonGenerationException
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 Summary
Fields inherited from class com.fasterxml.jackson.core.JsonProcessingException
_location
-
Constructor Summary
ModifierConstructorDescriptionprotected
StreamWriteException
(String msg, JsonGenerator g) protected
StreamWriteException
(String msg, Throwable rootCause, JsonGenerator g) protected
StreamWriteException
(Throwable rootCause, JsonGenerator g) -
Method Summary
Modifier and TypeMethodDescriptionMethod that allows accessing underlying processor that triggered this exception; typically eitherJsonParser
orJsonGenerator
for exceptions that originate from streaming API.abstract StreamWriteException
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, getMessageSuffix, getOriginalMessage, toString
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
_processor
-
-
Constructor Details
-
StreamWriteException
-
StreamWriteException
-
StreamWriteException
-
-
Method Details
-
withGenerator
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
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.
-