Package spark
Class ExceptionHandlerImpl<T extends java.lang.Exception>
- java.lang.Object
-
- spark.ExceptionHandlerImpl<T>
-
- All Implemented Interfaces:
ExceptionHandler<T>
public abstract class ExceptionHandlerImpl<T extends java.lang.Exception> extends java.lang.Object implements ExceptionHandler<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<? extends T>
exceptionClass
Holds the type of exception that this filter will handle
-
Constructor Summary
Constructors Constructor Description ExceptionHandlerImpl(java.lang.Class<T> exceptionClass)
Initializes the filter with the provided exception type
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends T>
exceptionClass()
Returns type of exception that this filter will handlevoid
exceptionClass(java.lang.Class<? extends T> exceptionClass)
Sets the type of exception that this filter will handleabstract void
handle(T exception, Request request, Response response)
Invoked when an exception that is mapped to this handler occurs during routing
-
-
-
Field Detail
-
exceptionClass
protected java.lang.Class<? extends T extends java.lang.Exception> exceptionClass
Holds the type of exception that this filter will handle
-
-
Constructor Detail
-
ExceptionHandlerImpl
public ExceptionHandlerImpl(java.lang.Class<T> exceptionClass)
Initializes the filter with the provided exception type- Parameters:
exceptionClass
- Type of exception
-
-
Method Detail
-
exceptionClass
public java.lang.Class<? extends T> exceptionClass()
Returns type of exception that this filter will handle- Returns:
- Type of exception
-
exceptionClass
public void exceptionClass(java.lang.Class<? extends T> exceptionClass)
Sets the type of exception that this filter will handle- Parameters:
exceptionClass
- Type of exception
-
handle
public abstract void handle(T exception, Request request, Response response)
Invoked when an exception that is mapped to this handler occurs during routing- Specified by:
handle
in interfaceExceptionHandler<T extends java.lang.Exception>
- Parameters:
exception
- The exception that was thrown during routingrequest
- The request object providing information about the HTTP requestresponse
- The response object providing functionality for modifying the response
-
-