public abstract class AbstractMapper<E extends java.lang.Throwable>
extends java.lang.Object
implements javax.ws.rs.ext.ExceptionMapper<E>
Modifier and Type | Field and Description |
---|---|
protected java.lang.Throwable |
error
Holds the current exception for use in subclasses.
|
Constructor and Description |
---|
AbstractMapper() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
messageFrom(java.lang.Throwable exception)
Produces a response message from the supplied exception.
|
protected javax.ws.rs.core.Response.ResponseBuilder |
response(javax.ws.rs.core.Response.Status status,
java.lang.Throwable exception)
Produces a response builder primed with the supplied status code
and JSON entity with the status code and exception message.
|
protected abstract javax.ws.rs.core.Response.Status |
responseStatus()
Returns the response status to be given when the exception occurs.
|
javax.ws.rs.core.Response |
toResponse(E exception) |
protected java.lang.Throwable error
protected abstract javax.ws.rs.core.Response.Status responseStatus()
public javax.ws.rs.core.Response toResponse(E exception)
toResponse
in interface javax.ws.rs.ext.ExceptionMapper<E extends java.lang.Throwable>
protected javax.ws.rs.core.Response.ResponseBuilder response(javax.ws.rs.core.Response.Status status, java.lang.Throwable exception)
status
- response statusexception
- exception to encodeprotected java.lang.String messageFrom(java.lang.Throwable exception)
exception
- exception from which to produce a message