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

public Class JsonParseExceptionMapper

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

Implementation of ExceptionMapper to send down a "400 Bad Request" in the event unparsable 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(JsonParseException
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

JsonParseExceptionMapperback to summary
public JsonParseExceptionMapper()

Method Detail

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

the exception to map to a response.

Returns:Response

a response mapped from the supplied exception.

Annotations
@Override