Package spark

Class ExceptionHandlerImpl<T extends java.lang.Exception>

  • 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 handle
      void exceptionClass​(java.lang.Class<? extends T> exceptionClass)
      Sets the type of exception that this filter will handle
      abstract void handle​(T exception, Request request, Response response)
      Invoked when an exception that is mapped to this handler occurs during routing
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 interface ExceptionHandler<T extends java.lang.Exception>
        Parameters:
        exception - The exception that was thrown during routing
        request - The request object providing information about the HTTP request
        response - The response object providing functionality for modifying the response