T - A type of the exception processed by the exception mapper.@Singleton public abstract class AbstractErrorTemplateMapper<T extends Throwable> extends Object implements org.glassfish.jersey.spi.ExtendedExceptionMapper<T>
ExtendedExceptionMapper used to declare special handling for exception types that should be
processed by MVC.
Extensions should override getErrorStatus(Throwable) and getErrorModel(Throwable) to provide a response
status and model derived from a raised throwable.
By default every exception is mapped and used as a model in a viewable and passed to the MVC runtime for
further processing.| Constructor and Description |
|---|
AbstractErrorTemplateMapper() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
getErrorModel(T throwable)
Get a model for error template.
|
protected javax.ws.rs.core.Response.Status |
getErrorStatus(T throwable)
Get a response status of to-be-processed error template.
|
boolean |
isMappable(T throwable) |
javax.ws.rs.core.Response |
toResponse(T throwable) |
public final boolean isMappable(T throwable)
public final javax.ws.rs.core.Response toResponse(T throwable)
protected Object getErrorModel(T throwable)
throwable itself.throwable - throwable raised during processing a resource method.protected javax.ws.rs.core.Response.Status getErrorStatus(T throwable)
Response.Status#OK.throwable - throwable raised during processing a resource method.Copyright © 2007-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.