Class UnknownSpringWebHelper

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCookie​(org.springframework.web.context.request.NativeWebRequest request, java.lang.String cookieName, java.lang.String cookieValue)
      Adds the specified cookie to the response.
      void addHeader​(org.springframework.web.context.request.NativeWebRequest request, java.lang.String headerName, java.lang.String... headerValues)
      Adds a response header with the given name and value.
      java.lang.Object getBestMatchingHandler​(org.springframework.web.context.request.NativeWebRequest request)
      Get the mapped handler for the best matching pattern.
      java.lang.String getBestMatchingPattern​(org.springframework.web.context.request.NativeWebRequest request)
      Get the best matching pattern within the handler mapping.
      java.lang.String getCookieValue​(org.springframework.web.context.request.NativeWebRequest request, java.lang.String cookieName)
      Get the cookie value for the given cookie name.
      java.util.Map<java.lang.String,​org.springframework.util.MultiValueMap<java.lang.String,​java.lang.String>> getMatrixVariables​(org.springframework.web.context.request.NativeWebRequest request)
      Get a map with URI variable names and a corresponding MultiValueMap of URI matrix variables for each.
      java.lang.String getMethod​(org.springframework.web.context.request.NativeWebRequest request)
      Get the HTTP method of the request
      java.lang.String getPathWithinHandlerMapping​(org.springframework.web.context.request.NativeWebRequest request)
      Get the path within the handler mapping, in case of a pattern match, or the full relevant URI (typically within the DispatcherServlet's mapping) else.
      java.util.Set<org.springframework.http.MediaType> getProducibleMediaTypes​(org.springframework.web.context.request.NativeWebRequest request)
      Get the set of producible MediaTypes applicable to the mapped handler.
      <T> T getRequestBody​(org.springframework.web.context.request.NativeWebRequest request, java.lang.Class<T> requestBodyType)
      Get the request body for the given request body type.
      SpringWebType getType()
      Get the Spring Web Type
      java.util.Map<java.lang.String,​java.lang.String> getUriTemplateVariables​(org.springframework.web.context.request.NativeWebRequest request)
      Get the URI templates map, mapping variable names to values.
      void setHeader​(org.springframework.web.context.request.NativeWebRequest request, java.lang.String headerName, java.lang.String headerValue)
      Sets a response header with the given name and value.
      • Methods inherited from class java.lang.Object

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

      • UnknownSpringWebHelper

        public UnknownSpringWebHelper()
    • Method Detail

      • getMethod

        public java.lang.String getMethod​(org.springframework.web.context.request.NativeWebRequest request)
        Description copied from interface: SpringWebHelper
        Get the HTTP method of the request
        Specified by:
        getMethod in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        Returns:
        the HTTP method if found, otherwise null
        See Also:
        HttpServletRequest.getMethod(), HttpRequest.getMethod()
      • setHeader

        public void setHeader​(org.springframework.web.context.request.NativeWebRequest request,
                              java.lang.String headerName,
                              java.lang.String headerValue)
        Description copied from interface: SpringWebHelper
        Sets a response header with the given name and value. If the header had already been set, the new value overwrites all previous values.
        Specified by:
        setHeader in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        headerName - the name of header
        headerValue - the header value
        See Also:
        HttpServletResponse.setHeader(String, String), HttpHeaders.set(String, String)
      • addHeader

        public void addHeader​(org.springframework.web.context.request.NativeWebRequest request,
                              java.lang.String headerName,
                              java.lang.String... headerValues)
        Description copied from interface: SpringWebHelper
        Adds a response header with the given name and value. This method allows response headers to have multiple values.
        Specified by:
        addHeader in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        headerName - the name of header
        headerValues - the header values
        See Also:
        HttpServletResponse.addHeader(String, String), HttpHeaders.add(String, String)
      • getCookieValue

        public java.lang.String getCookieValue​(org.springframework.web.context.request.NativeWebRequest request,
                                               java.lang.String cookieName)
        Description copied from interface: SpringWebHelper
        Get the cookie value for the given cookie name.
        Specified by:
        getCookieValue in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        cookieName - the name of Cookie
        Returns:
        the cookie value if found, otherwise null
        See Also:
        HttpServletRequest.getCookies(), ServerHttpRequest.getCookies()
      • addCookie

        public void addCookie​(org.springframework.web.context.request.NativeWebRequest request,
                              java.lang.String cookieName,
                              java.lang.String cookieValue)
        Description copied from interface: SpringWebHelper
        Adds the specified cookie to the response. This method can be called multiple times to set more than one cookie.
        Specified by:
        addCookie in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        cookieName - the name of Cookie
        cookieValue - the cookie value
        See Also:
        HttpServletResponse.addCookie(Cookie), ServerHttpResponse.addCookie(org.springframework.http.ResponseCookie)
      • getRequestBody

        public <T> T getRequestBody​(org.springframework.web.context.request.NativeWebRequest request,
                                    java.lang.Class<T> requestBodyType)
        Description copied from interface: SpringWebHelper
        Get the request body for the given request body type.
        Specified by:
        getRequestBody in interface SpringWebHelper
        Type Parameters:
        T - the type of request body
        Parameters:
        request - the NativeWebRequest
        requestBodyType - the request body type
        Returns:
        the request body if found, otherwise null
        See Also:
        RequestBody, org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor#resolveArgument, org.springframework.web.reactive.result.method.annotation.RequestBodyMethodArgumentResolver#resolveArgument
      • getBestMatchingHandler

        public java.lang.Object getBestMatchingHandler​(org.springframework.web.context.request.NativeWebRequest request)
        Description copied from interface: SpringWebHelper
        Get the mapped handler for the best matching pattern.
        Specified by:
        getBestMatchingHandler in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        Returns:
        the mapped handler for the best matching pattern if found, otherwise null
        See Also:
        HandlerMethod, org.springframework.web.servlet.function.RouterFunction, org.springframework.web.reactive.function.server.RouterFunction, org.springframework.web.servlet.HandlerMapping#getHandler, org.springframework.web.reactive.HandlerMapping#getHandler, org.springframework.web.servlet.HandlerMapping#BEST_MATCHING_HANDLER_ATTRIBUTE, org.springframework.web.reactive.HandlerMapping#BEST_MATCHING_HANDLER_ATTRIBUTE
      • getPathWithinHandlerMapping

        public java.lang.String getPathWithinHandlerMapping​(org.springframework.web.context.request.NativeWebRequest request)
        Description copied from interface: SpringWebHelper
        Get the path within the handler mapping, in case of a pattern match, or the full relevant URI (typically within the DispatcherServlet's mapping) else.
        Specified by:
        getPathWithinHandlerMapping in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        Returns:
        the path within handler mapping if found, otherwise null
        See Also:
        org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#exposePathWithinMapping, org.springframework.web.reactive.handler.AbstractUrlHandlerMapping#lookupHandler, org.springframework.web.servlet.HandlerMapping#PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, org.springframework.web.reactive.HandlerMapping#PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
      • getBestMatchingPattern

        public java.lang.String getBestMatchingPattern​(org.springframework.web.context.request.NativeWebRequest request)
        Description copied from interface: SpringWebHelper
        Get the best matching pattern within the handler mapping.
        Specified by:
        getBestMatchingPattern in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        Returns:
        the best matching pattern within the handler mapping if found, otherwise null
        See Also:
        RequestMapping.path(), org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#exposePathWithinMapping, org.springframework.web.reactive.handler.AbstractUrlHandlerMapping#lookupHandler, org.springframework.web.servlet.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE, org.springframework.web.reactive.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE
      • getUriTemplateVariables

        public java.util.Map<java.lang.String,​java.lang.String> getUriTemplateVariables​(org.springframework.web.context.request.NativeWebRequest request)
        Description copied from interface: SpringWebHelper
        Get the URI templates map, mapping variable names to values.
        Specified by:
        getUriTemplateVariables in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        Returns:
        the URI template variables if found, otherwise null
        See Also:
        PathVariable, org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#exposeUriTemplateVariables, org.springframework.web.reactive.handler.AbstractUrlHandlerMapping#lookupHandler, org.springframework.web.servlet.HandlerMapping#URI_TEMPLATE_VARIABLES_ATTRIBUTE, org.springframework.web.reactive.HandlerMapping#URI_TEMPLATE_VARIABLES_ATTRIBUTE
      • getMatrixVariables

        public java.util.Map<java.lang.String,​org.springframework.util.MultiValueMap<java.lang.String,​java.lang.String>> getMatrixVariables​(org.springframework.web.context.request.NativeWebRequest request)
        Description copied from interface: SpringWebHelper
        Get a map with URI variable names and a corresponding MultiValueMap of URI matrix variables for each.
        Specified by:
        getMatrixVariables in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        Returns:
        the matrix variables if found, otherwise null
        See Also:
        MatrixVariable, org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMapMethodArgumentResolver#resolveArgument, org.springframework.web.reactive.result.method.annotation.MatrixVariableMapMethodArgumentResolver#resolveArgumentValue, org.springframework.web.servlet.HandlerMapping#MATRIX_VARIABLES_ATTRIBUTE, org.springframework.web.reactive.HandlerMapping#MATRIX_VARIABLES_ATTRIBUTE
      • getProducibleMediaTypes

        public java.util.Set<org.springframework.http.MediaType> getProducibleMediaTypes​(org.springframework.web.context.request.NativeWebRequest request)
        Description copied from interface: SpringWebHelper
        Get the set of producible MediaTypes applicable to the mapped handler.
        Specified by:
        getProducibleMediaTypes in interface SpringWebHelper
        Parameters:
        request - the NativeWebRequest
        Returns:
        the producible media types if found, otherwise null
        See Also:
        RequestMapping.produces(), org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping#handleMatch, org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping#handleMatch, org.springframework.web.servlet.HandlerMapping#PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, org.springframework.web.reactive.HandlerMapping#PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE