Class ModelAndViewBridge

java.lang.Object
net.officefloor.spring.starter.rest.ModelAndViewBridge

public class ModelAndViewBridge extends Object
Bridge to Spring for the ModelAndView.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    HandlerMethod for OfficeFloor bridging.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModelAndViewBridge(Method method, org.springframework.web.method.support.ModelAndViewContainer modelAndViewContainer, Object handler, org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter handlerAdapter, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse, org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.servlet.DispatcherServlet dispatcherServlet, org.springframework.context.ApplicationContext applicationContext)
    Instantiate.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.context.ApplicationContext
    Obtains the ApplicationContext.
    org.springframework.web.servlet.DispatcherServlet
    Obtains the DispatcherServlet.
    org.springframework.web.method.HandlerMethod
    Obtains the HandlerMethod.
    jakarta.servlet.http.HttpServletRequest
    Obtains the HttpServletRequest.
    jakarta.servlet.http.HttpServletResponse
    Obtains the HttpServletResponse.
    org.springframework.web.servlet.ModelAndView
    Obtains the ModelAndView from the current state.
    org.springframework.web.method.support.ModelAndViewContainer
    Obtains the ModelAndViewContainer.
    org.springframework.web.method.annotation.ModelFactory
    Obtains the ModelFactory.
    org.springframework.web.context.request.NativeWebRequest
    Obtains the NativeWebRequest.
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
    Obtains the RequestMappingHandlerAdapter.
    org.springframework.web.bind.support.WebDataBinderFactory
    Obtains the WebDataBinderFactory.
    void
    processDispatchResult(org.springframework.web.servlet.ModelAndView modelAndView, Throwable ex)
    Delegates to the DispatcherServlet to process the results.
    void
    Writes the return value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModelAndViewBridge

      public ModelAndViewBridge(Method method, org.springframework.web.method.support.ModelAndViewContainer modelAndViewContainer, Object handler, org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter handlerAdapter, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse, org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.servlet.DispatcherServlet dispatcherServlet, org.springframework.context.ApplicationContext applicationContext) throws Exception
      Instantiate.
      Parameters:
      method - Method being bridged.
      modelAndViewContainer - ModelAndViewContainer.
      handler - Handler object.
      handlerAdapter - RequestMappingHandlerAdapter.
      servletRequest - HttpServletRequest.
      servletResponse - HttpServletResponse.
      webRequest - NativeWebRequest.
      dispatcherServlet - DispatcherServlet.
      applicationContext - ApplicationContext.
      Throws:
      Exception - If fails to create the bridge.
  • Method Details

    • getModelAndViewContainer

      public org.springframework.web.method.support.ModelAndViewContainer getModelAndViewContainer()
      Obtains the ModelAndViewContainer.
      Returns:
      ModelAndViewContainer.
    • getHandlerMethod

      public org.springframework.web.method.HandlerMethod getHandlerMethod()
      Obtains the HandlerMethod.
      Returns:
      HandlerMethod.
    • getRequestMappingHandlerAdapter

      public org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter getRequestMappingHandlerAdapter()
      Obtains the RequestMappingHandlerAdapter.
      Returns:
      RequestMappingHandlerAdapter.
    • getWebDataBinderFactory

      public org.springframework.web.bind.support.WebDataBinderFactory getWebDataBinderFactory() throws Exception
      Obtains the WebDataBinderFactory.
      Returns:
      WebDataBinderFactory.
      Throws:
      Exception - If fails to obtain the WebDataBinderFactory.
    • getModelFactory

      public org.springframework.web.method.annotation.ModelFactory getModelFactory() throws Exception
      Obtains the ModelFactory.
      Returns:
      ModelFactory.
      Throws:
      Exception - If fails to obtain the ModelFactory.
    • getHttpServletRequest

      public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()
      Obtains the HttpServletRequest.
      Returns:
      HttpServletRequest.
    • getHttpServletResponse

      public jakarta.servlet.http.HttpServletResponse getHttpServletResponse()
      Obtains the HttpServletResponse.
      Returns:
      HttpServletResponse.
    • getNativeWebRequest

      public org.springframework.web.context.request.NativeWebRequest getNativeWebRequest()
      Obtains the NativeWebRequest.
      Returns:
      NativeWebRequest.
    • getDispatcherServlet

      public org.springframework.web.servlet.DispatcherServlet getDispatcherServlet()
      Obtains the DispatcherServlet.
      Returns:
      DispatcherServlet.
    • getApplicationContext

      public org.springframework.context.ApplicationContext getApplicationContext()
      Obtains the ApplicationContext.
      Returns:
      ApplicationContext.
    • writeObjectResponse

      public void writeObjectResponse(Object returnValue) throws Exception
      Writes the return value.
      Parameters:
      returnValue - Return value.
      Throws:
      Exception - If fails to write the return value.
    • getModelAndView

      public org.springframework.web.servlet.ModelAndView getModelAndView(String view) throws Exception
      Obtains the ModelAndView from the current state.
      Parameters:
      view - Name of the view.
      Returns:
      ModelAndView from the current state.
      Throws:
      Exception - If fails to obtain the ModelAndView.
    • processDispatchResult

      public void processDispatchResult(org.springframework.web.servlet.ModelAndView modelAndView, Throwable ex) throws Exception
      Delegates to the DispatcherServlet to process the results.
      Parameters:
      modelAndView - ModelAndView. May be null.
      ex - Exception. May be null.
      Throws:
      Exception - If fails to process.