Top Description Constructors Methods
com.fasterxml.jackson.jakarta.rs.base

public Class JsonParseExceptionMapper

extends Object
implements ExceptionMapper<JsonParseException>
Class Inheritance
All Implemented Interfaces
jakarta.ws.rs.ext.ExceptionMapper
Imports
com.fasterxml.jackson.core.JsonParseException, jakarta.ws.rs.core.Response, jakarta.ws.rs.ext.ExceptionMapper

Implementation of ExceptionMapper to send down a "400 Bad Request" in the event unparsable JSON is received.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Response
toResponse(JsonParseException
the exception to map to a response.
exception
)

Implements jakarta.ws.rs.ext.ExceptionMapper.toResponse.

Map an exception to a jakarta.ws.rs.core.Response.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JsonParseExceptionMapperback to summary
public JsonParseExceptionMapper()

Method Detail

toResponseback to summary
public Response toResponse(JsonParseException exception)

Implements jakarta.ws.rs.ext.ExceptionMapper.toResponse.

Doc from jakarta.ws.rs.ext.ExceptionMapper.toResponse.

Map an exception to a jakarta.ws.rs.core.Response. Returning null results in a jakarta.ws.rs.core.Response.Status#NO_CONTENT response. Throwing a runtime exception results in a jakarta.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR response.

Parameters
exception:JsonParseException

the exception to map to a response.

Returns:Response

a response mapped from the supplied exception.

Annotations
@Override