Package org.onlab.rest.exceptions
Class WebApplicationExceptionMapper
- java.lang.Object
-
- org.onlab.rest.exceptions.AbstractMapper<javax.ws.rs.WebApplicationException>
-
- org.onlab.rest.exceptions.WebApplicationExceptionMapper
-
- All Implemented Interfaces:
javax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>
@Provider public class WebApplicationExceptionMapper extends AbstractMapper<javax.ws.rs.WebApplicationException>
Exception mapper for WebApplicationExceptions.
-
-
Field Summary
-
Fields inherited from class org.onlab.rest.exceptions.AbstractMapper
error
-
-
Constructor Summary
Constructors Constructor Description WebApplicationExceptionMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response.Status
responseStatus()
Returns the response status to be given when the exception occurs.javax.ws.rs.core.Response
toResponse(javax.ws.rs.WebApplicationException e)
Extracts and returns the response from a WebApplicationException.-
Methods inherited from class org.onlab.rest.exceptions.AbstractMapper
messageFrom, response
-
-
-
-
Method Detail
-
toResponse
public javax.ws.rs.core.Response toResponse(javax.ws.rs.WebApplicationException e)
Extracts and returns the response from a WebApplicationException.- Specified by:
toResponse
in interfacejavax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>
- Overrides:
toResponse
in classAbstractMapper<javax.ws.rs.WebApplicationException>
- Parameters:
e
- WebApplicationException that was thrown- Returns:
- precomputed Response from the exception
-
responseStatus
public javax.ws.rs.core.Response.Status responseStatus()
Description copied from class:AbstractMapper
Returns the response status to be given when the exception occurs.- Specified by:
responseStatus
in classAbstractMapper<javax.ws.rs.WebApplicationException>
- Returns:
- response status
-
-