Top Description Fields Constructors Methods
com.fasterxml.jackson.core.exc

public abstract Class StreamReadException

extends JsonProcessingException
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.core.exc.InputCoercionException
Imports
com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.util.RequestPayload

Intermediate base class for all read-side streaming processing problems, including parsing and input value coercion problems.

Added in 2.10 to eventually replace com.fasterxml.jackson.core.JsonParseException.

Since
2.10

Field Summary

Modifier and TypeField and Description
protected transient JsonParser
protected RequestPayload
_requestPayload

Optional payload that can be assigned to pass along for error reporting or handling purposes.

pack-priv static final long
Inherited from com.fasterxml.jackson.core.JsonProcessingException:
_location

Constructor Summary

AccessConstructor and Description
protected
protected
protected
protected
protected
protected

Method Summary

Modifier and TypeMethod and Description
public String
getMessage()

Overrides com.fasterxml.jackson.core.JsonProcessingException.getMessage.

Overriding the getMessage() to include the request body
public JsonParser
getProcessor()

Overrides com.fasterxml.jackson.core.JsonProcessingException.getProcessor.

Method that allows accessing underlying processor that triggered this exception; typically either JsonParser or JsonGenerator for exceptions that originate from streaming API.
public RequestPayload

Returns:

request body, if payload was specified; `null` otherwise
getRequestPayload
()

Method that may be called to find payload that was being parsed, if one was specified for parser that threw this Exception.

public String

Returns:

request body as String, if payload was specified; `null` otherwise
getRequestPayloadAsString
()

The method returns the String representation of the request payload if one was specified for parser that threw this Exception.

public abstract StreamReadException

Returns:

This exception instance to allow call chaining
withParser
(JsonParser
Parser instance to assign to this exception
p
)

Fluent method that may be used to assign originating JsonParser, to be accessed using getProcessor().

public abstract StreamReadException

Returns:

This exception instance to allow call chaining
withRequestPayload
(RequestPayload
Payload to assign to this exception
payload
)

Fluent method that may be used to assign payload to this exception, to let recipient access it for diagnostics purposes.

Inherited from com.fasterxml.jackson.core.JsonProcessingException:
clearLocationgetLocationgetMessageSuffixgetOriginalMessagetoString

Field Detail

_processorback to summary
protected transient JsonParser _processor
_requestPayloadback to summary
protected RequestPayload _requestPayload

Optional payload that can be assigned to pass along for error reporting or handling purposes. Core streaming parser implementations DO NOT initialize this; it is up to using applications and frameworks to populate it.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.fasterxml.jackson.core.JsonProcessingException.serialVersionUID.

Constructor Detail

StreamReadExceptionback to summary
protected StreamReadException(JsonParser p, String msg)
StreamReadExceptionback to summary
protected StreamReadException(JsonParser p, String msg, Throwable root)
StreamReadExceptionback to summary
protected StreamReadException(JsonParser p, String msg, JsonLocation loc)
StreamReadExceptionback to summary
protected StreamReadException(JsonParser p, String msg, JsonLocation loc, Throwable rootCause)
StreamReadExceptionback to summary
protected StreamReadException(String msg, JsonLocation loc, Throwable rootCause)
StreamReadExceptionback to summary
protected StreamReadException(String msg)

Method Detail

getMessageback to summary
public String getMessage()

Overrides com.fasterxml.jackson.core.JsonProcessingException.getMessage.

Overriding the getMessage() to include the request body

Returns:String

Doc from com.fasterxml.jackson.core.JsonProcessingException.getMessage.

Original message preceded by optional prefix and followed by location information, message and location information separated by a linefeed

Annotations
@Override
getProcessorback to summary
public JsonParser getProcessor()

Overrides com.fasterxml.jackson.core.JsonProcessingException.getProcessor.

Doc from com.fasterxml.jackson.core.JsonProcessingException.getProcessor.

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.

Returns:JsonParser

Originating processor, if available; null if not.

Annotations
@Override
getRequestPayloadback to summary
public RequestPayload getRequestPayload()

Method that may be called to find payload that was being parsed, if one was specified for parser that threw this Exception.

Returns:RequestPayload

request body, if payload was specified; `null` otherwise

getRequestPayloadAsStringback to summary
public String getRequestPayloadAsString()

The method returns the String representation of the request payload if one was specified for parser that threw this Exception.

Returns:String

request body as String, if payload was specified; `null` otherwise

withParserback to summary
public abstract StreamReadException withParser(JsonParser p)

Fluent method that may be used to assign originating JsonParser, to be accessed using getProcessor().

Note

`this` instance is modified and no new instance is constructed.

Parameters
p:JsonParser

Parser instance to assign to this exception

Returns:StreamReadException

This exception instance to allow call chaining

withRequestPayloadback to summary
public abstract StreamReadException withRequestPayload(RequestPayload payload)

Fluent method that may be used to assign payload to this exception, to let recipient access it for diagnostics purposes.

Note

`this` instance is modified and no new instance is constructed.

Parameters
payload:RequestPayload

Payload to assign to this exception

Returns:StreamReadException

This exception instance to allow call chaining