Class ExceptionHandlerExtensions


  • public final class ExceptionHandlerExtensions
    extends java.lang.Object
    The class ExceptionHandlerExtensions holds factory methods for create the view model bean for exception representations
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ExceptionViewModel newExceptionViewModel​(javax.servlet.http.HttpServletRequest request, org.springframework.http.HttpStatus httpStatus, java.lang.String developerMessage, java.lang.String userMessage)
      Factory method for create a new ExceptionViewModel from the given arguments
      static ExceptionViewModel newExceptionViewModel​(org.springframework.web.context.request.ServletWebRequest request, org.springframework.http.HttpStatus status, java.lang.String developerMessage, java.lang.String userMessage)
      Factory method for create a new ExceptionViewModel from the given arguments
      static ExceptionViewModel newExceptionViewModelWith​(org.springframework.web.context.request.WebRequest request, org.springframework.http.HttpStatus status, java.lang.String developerMessage, java.lang.String userMessage)
      Factory method for create a new ExceptionViewModel from the given arguments
      static org.springframework.http.ResponseEntity<java.lang.Object> newResponseEntity​(ExceptionViewModel exceptionViewModel)
      Factory method for create a new ResponseEntity with the given ExceptionViewModel object
      static org.springframework.http.ResponseEntity<java.lang.Object> newResponseEntity​(org.springframework.validation.BindException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request, org.springframework.context.MessageSource messageSource)
      Factory method for create a new ResponseEntity from the given arguments
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newResponseEntity

        public static org.springframework.http.ResponseEntity<java.lang.Object> newResponseEntity​(ExceptionViewModel exceptionViewModel)
        Factory method for create a new ResponseEntity with the given ExceptionViewModel object
        Parameters:
        exceptionViewModel - the ExceptionViewModel object
        Returns:
        the new ResponseEntity object
      • newExceptionViewModelWith

        public static ExceptionViewModel newExceptionViewModelWith​(org.springframework.web.context.request.WebRequest request,
                                                                   org.springframework.http.HttpStatus status,
                                                                   java.lang.String developerMessage,
                                                                   java.lang.String userMessage)
        Factory method for create a new ExceptionViewModel from the given arguments
        Parameters:
        request - the request
        status - the status
        developerMessage - the developer message
        userMessage - the user message
        Returns:
        the new ExceptionViewModel object
      • newExceptionViewModel

        public static ExceptionViewModel newExceptionViewModel​(org.springframework.web.context.request.ServletWebRequest request,
                                                               org.springframework.http.HttpStatus status,
                                                               java.lang.String developerMessage,
                                                               java.lang.String userMessage)
        Factory method for create a new ExceptionViewModel from the given arguments
        Parameters:
        request - the request
        status - the status
        developerMessage - the developer message
        userMessage - the user message
        Returns:
        the new ExceptionViewModel object
      • newExceptionViewModel

        public static ExceptionViewModel newExceptionViewModel​(javax.servlet.http.HttpServletRequest request,
                                                               org.springframework.http.HttpStatus httpStatus,
                                                               java.lang.String developerMessage,
                                                               java.lang.String userMessage)
        Factory method for create a new ExceptionViewModel from the given arguments
        Parameters:
        request - the request
        httpStatus - the http status
        developerMessage - the developer message
        userMessage - the user message
        Returns:
        the new ExceptionViewModel object
      • newResponseEntity

        public static org.springframework.http.ResponseEntity<java.lang.Object> newResponseEntity​(org.springframework.validation.BindException exception,
                                                                                                  org.springframework.http.HttpHeaders headers,
                                                                                                  org.springframework.http.HttpStatus status,
                                                                                                  org.springframework.web.context.request.WebRequest request,
                                                                                                  org.springframework.context.MessageSource messageSource)
        Factory method for create a new ResponseEntity from the given arguments
        Parameters:
        exception - the exception
        headers - the headers
        status - the status
        request - the request
        messageSource - the message source
        Returns:
        the new ResponseEntity object