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

public Class JsonGenerationException

extends StreamWriteException
Class Inheritance
Imports
com.fasterxml.jackson.core.exc.StreamWriteException

Exception type for exceptions during JSON writing, such as trying to output content in wrong context (non-matching end-array or end-object, for example).

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from com.fasterxml.jackson.core.exc.StreamWriteException:
_processor

Constructor Summary

AccessConstructor and Description
public
JsonGenerationException(Throwable rootCause)
Deprecated

public
public
JsonGenerationException(String msg, Throwable rootCause)
Deprecated

public
public
public

Method Summary

Modifier and TypeMethod and Description
public JsonGenerator
getProcessor()

Overrides com.fasterxml.jackson.core.exc.StreamWriteException.getProcessor.

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

public JsonGenerationException

Returns:

This exception instance (to allow call chaining)
withGenerator
(JsonGenerator
Generator to assign
g
)

Implements abstract com.fasterxml.jackson.core.exc.StreamWriteException.withGenerator.

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

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.core.exc.StreamWriteException.serialVersionUID.

Constructor Detail

JsonGenerationExceptionback to summary
public JsonGenerationException(Throwable rootCause)

Deprecated

Annotations
@Deprecated
JsonGenerationExceptionback to summary
public JsonGenerationException(String msg)

Deprecated

Annotations
@Deprecated
JsonGenerationExceptionback to summary
public JsonGenerationException(String msg, Throwable rootCause)

Deprecated

Annotations
@Deprecated
JsonGenerationExceptionback to summary
public JsonGenerationException(Throwable rootCause, JsonGenerator g)
JsonGenerationExceptionback to summary
public JsonGenerationException(String msg, JsonGenerator g)
JsonGenerationExceptionback to summary
public JsonGenerationException(String msg, Throwable rootCause, JsonGenerator g)

Method Detail

getProcessorback to summary
public JsonGenerator getProcessor()

Overrides com.fasterxml.jackson.core.exc.StreamWriteException.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:JsonGenerator

Originating processor, if available; null if not.

Annotations
@Override
withGeneratorback to summary
public JsonGenerationException withGenerator(JsonGenerator g)

Implements abstract com.fasterxml.jackson.core.exc.StreamWriteException.withGenerator.

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

Parameters
g:JsonGenerator

Generator to assign

Returns:JsonGenerationException

This exception instance (to allow call chaining)

Annotations
@Override
Since
2.7