Top Description Constructors Methods
com.fasterxml.jackson.jaxrs.base

public Class JsonMappingExceptionMapper

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

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

Note that javax.ws.rs.ext.Provider annotation was include up to Jackson 2.7, but removed from 2.8 (as per [jaxrs-providers#22]

Since
2.2

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 javax.ws.rs.ext.ExceptionMapper.toResponse.

Map an exception to a javax.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 javax.ws.rs.ext.ExceptionMapper.toResponse.

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

Map an exception to a javax.ws.rs.core.Response. Returning null results in a javax.ws.rs.core.Response.Status#NO_CONTENT response. Throwing a runtime exception results in a javax.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