public abstract class AbstractMapper<E extends Throwable> extends Object implements javax.ws.rs.ext.ExceptionMapper<E>
Modifier and Type | Field and Description |
---|---|
protected Throwable |
error
Holds the current exception for use in subclasses.
|
Constructor and Description |
---|
AbstractMapper() |
Modifier and Type | Method and Description |
---|---|
protected String |
messageFrom(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,
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 Throwable error
protected abstract javax.ws.rs.core.Response.Status responseStatus()
public javax.ws.rs.core.Response toResponse(E exception)
protected javax.ws.rs.core.Response.ResponseBuilder response(javax.ws.rs.core.Response.Status status, Throwable exception)
status
- response statusexception
- exception to encodeprotected String messageFrom(Throwable exception)
exception
- exception from which to produce a message