Package io.microsphere.spring.web.util
Class UnknownSpringWebHelper
java.lang.Object
io.microsphere.spring.web.util.UnknownSpringWebHelper
- All Implemented Interfaces:
SpringWebHelper
Unknown
SpringWebHelper- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCookie(org.springframework.web.context.request.NativeWebRequest request, String cookieName, String cookieValue) Adds the specified cookie to the response.voidaddHeader(org.springframework.web.context.request.NativeWebRequest request, String headerName, String... headerValues) Adds a response header with the given name and value.getBestMatchingHandler(org.springframework.web.context.request.NativeWebRequest request) Get the mapped handler for the best matching pattern.getBestMatchingPattern(org.springframework.web.context.request.NativeWebRequest request) Get the best matching pattern within the handler mapping.getCookieValue(org.springframework.web.context.request.NativeWebRequest request, String cookieName) Get the cookie value for the given cookie name.getMatrixVariables(org.springframework.web.context.request.NativeWebRequest request) Get a map with URI variable names and a correspondingMultiValueMapof URI matrix variables for each.getMethod(org.springframework.web.context.request.NativeWebRequest request) Get the HTTP method of the requestgetPathWithinHandlerMapping(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.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> TgetRequestBody(org.springframework.web.context.request.NativeWebRequest request, Class<T> requestBodyType) Get the request body for the given request body type.getType()Get the Spring Web TypegetUriTemplateVariables(org.springframework.web.context.request.NativeWebRequest request) Get the URI templates map, mapping variable names to values.voidsetHeader(org.springframework.web.context.request.NativeWebRequest request, String headerName, 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, waitMethods inherited from interface io.microsphere.spring.web.util.SpringWebHelper
getHeader, getHeaderValues, writeResponseBody
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
UnknownSpringWebHelper
public UnknownSpringWebHelper()
-
-
Method Details
-
getMethod
Description copied from interface:SpringWebHelperGet the HTTP method of the request- Specified by:
getMethodin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequest- 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, String headerName, String headerValue) Description copied from interface:SpringWebHelperSets 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:
setHeaderin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequestheaderName- the name of headerheaderValue- the header value- See Also:
-
HttpServletResponse.setHeader(String, String)HttpHeaders.set(String, String)
-
addHeader
public void addHeader(org.springframework.web.context.request.NativeWebRequest request, String headerName, String... headerValues) Description copied from interface:SpringWebHelperAdds a response header with the given name and value. This method allows response headers to have multiple values.- Specified by:
addHeaderin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequestheaderName- the name of headerheaderValues- the header values- See Also:
-
HttpServletResponse.addHeader(String, String)HttpHeaders.add(String, String)
-
getCookieValue
public String getCookieValue(org.springframework.web.context.request.NativeWebRequest request, String cookieName) Description copied from interface:SpringWebHelperGet the cookie value for the given cookie name.- Specified by:
getCookieValuein interfaceSpringWebHelper- Parameters:
request- theNativeWebRequestcookieName- 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, String cookieName, String cookieValue) Description copied from interface:SpringWebHelperAdds the specified cookie to the response. This method can be called multiple times to set more than one cookie.- Specified by:
addCookiein interfaceSpringWebHelper- Parameters:
request- theNativeWebRequestcookieName- the name of CookiecookieValue- the cookie value- See Also:
-
HttpServletResponse.addCookie(Cookie)ServerHttpResponse.addCookie(ResponseCookie)
-
getRequestBody
public <T> T getRequestBody(org.springframework.web.context.request.NativeWebRequest request, Class<T> requestBodyType) Description copied from interface:SpringWebHelperGet the request body for the given request body type.- Specified by:
getRequestBodyin interfaceSpringWebHelper- Type Parameters:
T- the type of request body- Parameters:
request- theNativeWebRequestrequestBodyType- the request body type- Returns:
- the request body if found, otherwise
null - See Also:
-
RequestBodyorg.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor#resolveArgumentorg.springframework.web.reactive.result.method.annotation.RequestBodyMethodArgumentResolver#resolveArgument
-
getBestMatchingHandler
public Object getBestMatchingHandler(org.springframework.web.context.request.NativeWebRequest request) Description copied from interface:SpringWebHelperGet the mapped handler for the best matching pattern.- Specified by:
getBestMatchingHandlerin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequest- Returns:
- the mapped handler for the best matching pattern if found, otherwise
null - See Also:
-
HandlerMethodorg.springframework.web.servlet.function.RouterFunctionorg.springframework.web.reactive.function.server.RouterFunctionorg.springframework.web.servlet.HandlerMapping#getHandlerorg.springframework.web.reactive.HandlerMapping#getHandlerorg.springframework.web.servlet.HandlerMapping#BEST_MATCHING_HANDLER_ATTRIBUTEorg.springframework.web.reactive.HandlerMapping#BEST_MATCHING_HANDLER_ATTRIBUTE
-
getPathWithinHandlerMapping
public String getPathWithinHandlerMapping(org.springframework.web.context.request.NativeWebRequest request) Description copied from interface:SpringWebHelperGet 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:
getPathWithinHandlerMappingin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequest- Returns:
- the path within handler mapping if found, otherwise
null - See Also:
-
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#exposePathWithinMappingorg.springframework.web.reactive.handler.AbstractUrlHandlerMapping#lookupHandlerorg.springframework.web.servlet.HandlerMapping#PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTEorg.springframework.web.reactive.HandlerMapping#PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
-
getBestMatchingPattern
public String getBestMatchingPattern(org.springframework.web.context.request.NativeWebRequest request) Description copied from interface:SpringWebHelperGet the best matching pattern within the handler mapping.- Specified by:
getBestMatchingPatternin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequest- Returns:
- the best matching pattern within the handler mapping if found, otherwise
null - See Also:
-
RequestMapping.path()org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#exposePathWithinMappingorg.springframework.web.reactive.handler.AbstractUrlHandlerMapping#lookupHandlerorg.springframework.web.servlet.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTEorg.springframework.web.reactive.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE
-
getUriTemplateVariables
public Map<String,String> getUriTemplateVariables(org.springframework.web.context.request.NativeWebRequest request) Description copied from interface:SpringWebHelperGet the URI templates map, mapping variable names to values.- Specified by:
getUriTemplateVariablesin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequest- Returns:
- the URI template variables if found, otherwise
null - See Also:
-
PathVariableorg.springframework.web.servlet.handler.AbstractUrlHandlerMapping#exposeUriTemplateVariablesorg.springframework.web.reactive.handler.AbstractUrlHandlerMapping#lookupHandlerorg.springframework.web.servlet.HandlerMapping#URI_TEMPLATE_VARIABLES_ATTRIBUTEorg.springframework.web.reactive.HandlerMapping#URI_TEMPLATE_VARIABLES_ATTRIBUTE
-
getMatrixVariables
public Map<String,org.springframework.util.MultiValueMap<String, getMatrixVariablesString>> (org.springframework.web.context.request.NativeWebRequest request) Description copied from interface:SpringWebHelperGet a map with URI variable names and a correspondingMultiValueMapof URI matrix variables for each.- Specified by:
getMatrixVariablesin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequest- Returns:
- the matrix variables if found, otherwise
null - See Also:
-
MatrixVariableorg.springframework.web.servlet.mvc.method.annotation.MatrixVariableMapMethodArgumentResolver#resolveArgumentorg.springframework.web.reactive.result.method.annotation.MatrixVariableMapMethodArgumentResolver#resolveArgumentValueorg.springframework.web.servlet.HandlerMapping#MATRIX_VARIABLES_ATTRIBUTEorg.springframework.web.reactive.HandlerMapping#MATRIX_VARIABLES_ATTRIBUTE
-
getProducibleMediaTypes
public Set<org.springframework.http.MediaType> getProducibleMediaTypes(org.springframework.web.context.request.NativeWebRequest request) Description copied from interface:SpringWebHelperGet the set of producible MediaTypes applicable to the mapped handler.- Specified by:
getProducibleMediaTypesin interfaceSpringWebHelper- Parameters:
request- theNativeWebRequest- Returns:
- the producible media types if found, otherwise
null - See Also:
-
RequestMapping.produces()org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping#handleMatchorg.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping#handleMatchorg.springframework.web.servlet.HandlerMapping#PRODUCIBLE_MEDIA_TYPES_ATTRIBUTEorg.springframework.web.reactive.HandlerMapping#PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
-
getType
Description copied from interface:SpringWebHelperGet the Spring Web Type- Specified by:
getTypein interfaceSpringWebHelper- Returns:
SpringWebType
-