public abstract class StreamWriteException extends JsonProcessingException
Added in 2.13 to eventually replace JsonGenerationException
.
Modifier and Type | Field and Description |
---|---|
protected JsonGenerator |
_processor |
_location
Modifier | Constructor and Description |
---|---|
protected |
StreamWriteException(String msg,
JsonGenerator g) |
protected |
StreamWriteException(String msg,
Throwable rootCause,
JsonGenerator g) |
protected |
StreamWriteException(Throwable rootCause,
JsonGenerator g) |
Modifier and Type | Method and Description |
---|---|
JsonGenerator |
getProcessor()
Method that allows accessing underlying processor that triggered
this exception; typically either
JsonParser or JsonGenerator
for exceptions that originate from streaming API. |
abstract StreamWriteException |
withGenerator(JsonGenerator g)
Fluent method that may be used to assign originating
JsonGenerator ,
to be accessed using getProcessor() . |
clearLocation, getLocation, getMessage, getMessageSuffix, getOriginalMessage, toString
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
protected transient JsonGenerator _processor
protected StreamWriteException(Throwable rootCause, JsonGenerator g)
protected StreamWriteException(String msg, JsonGenerator g)
protected StreamWriteException(String msg, Throwable rootCause, JsonGenerator g)
public abstract StreamWriteException withGenerator(JsonGenerator g)
JsonGenerator
,
to be accessed using getProcessor()
.g
- Generator to assignpublic JsonGenerator getProcessor()
JsonProcessingException
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.getProcessor
in class JsonProcessingException
Copyright © 2008–2023 FasterXML. All rights reserved.