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

public Class JsonMappingExceptionMapper

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

Implementation if ExceptionMapper to send down a "400 Bad Request" response in the event that unmappable JSON is received.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Response
toResponse(JsonMappingException
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

JsonMappingExceptionMapperback to summary
public JsonMappingExceptionMapper()

Method Detail

toResponseback to summary
public Response toResponse(JsonMappingException 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:JsonMappingException

the exception to map to a response.

Returns:Response

a response mapped from the supplied exception.

Annotations
@Override