public class ExceptionMapper extends Object
Constructor and Description |
---|
ExceptionMapper()
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the exception mappings.
|
ExceptionHandlerImpl |
getHandler(Class<? extends Exception> exceptionClass)
Returns the handler associated with the provided exception class
|
ExceptionHandlerImpl |
getHandler(Exception exception)
Returns the handler associated with the provided exception class
|
static ExceptionMapper |
getInstance()
Returns the default instance for the exception mapper
|
void |
map(Class<? extends Exception> exceptionClass,
ExceptionHandlerImpl handler)
Maps the given handler to the provided exception type.
|
public static ExceptionMapper getInstance()
public void map(Class<? extends Exception> exceptionClass, ExceptionHandlerImpl handler)
exceptionClass
- Type of exceptionhandler
- Handler to map to exceptionpublic ExceptionHandlerImpl getHandler(Class<? extends Exception> exceptionClass)
exceptionClass
- Type of exceptionpublic ExceptionHandlerImpl getHandler(Exception exception)
exception
- Exception that occurredpublic void clear()
Copyright © 2018. All rights reserved.