public class CommerceHandlerMapping
extends RequestMappingHandlerMapping
RequestMappingInfo instances from type and method-level @RequestMapping
annotations in @Controller classes. Additionally it resolve RequestMapping conflicts base on
@RequestMappingOverride annotation. Method with highest priority will be added as
handler mapping. CommerceHandlerMapping use also @ApiVersion annotation to avoid adding request
mapping dedicated for different API version of commerce web services| Constructor and Description |
|---|
CommerceHandlerMapping(java.lang.String apiVersion) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
detectOverriddenMappings(java.lang.Object handler)
Looks for overridden request mapping.
|
int |
getDefaultRequestMappingOverridePriority() |
protected RequestMappingInfo |
getMappingForMethod(java.lang.reflect.Method method,
java.lang.Class<?> handlerType)
Gets mapping from parent method and check if it wasn't overridden by
RequestMappingOverride annotation |
protected java.lang.Integer |
getMethodPriorityValue(java.lang.reflect.Method method)
Gets method priority value based on
RequestMappingOverride annotation. |
java.util.Map<RequestMappingInfo,java.lang.Integer> |
getOverriddenRequestMapping() |
protected boolean |
hasRequestMappingOverrideAnnotation(java.lang.reflect.Method method)
Checks if method has
RequestMappingOverride annotation |
protected void |
initHandlerMethods()
Scan beans in the ApplicationContext, detect and register handler methods.
|
protected void |
initOverridenRequestMappings()
Scan beans in the ApplicationContext, detect and register overridden request mappings.
|
protected boolean |
isHandler(java.lang.Class<?> beanType) |
protected boolean |
isRequestMappingOverridden(RequestMappingInfo mapping,
java.lang.reflect.Method method)
Method checks if mapping was overridden
|
protected void |
registerOverriddenMapping(java.lang.reflect.Method method,
RequestMappingInfo mapping)
Adds overridden request mapping to map
|
void |
setDefaultRequestMappingOverridePriority(int defaultRequestMappingOverridePriority) |
void |
setDetectHandlerMethodsInAncestorContexts(boolean detectHandlerMethodsInAncestorContexts) |
public CommerceHandlerMapping(java.lang.String apiVersion)
apiVersion - - Api version for which this request handler mapping should be definedprotected boolean isHandler(java.lang.Class<?> beanType)
protected void initHandlerMethods()
protected RequestMappingInfo getMappingForMethod(java.lang.reflect.Method method,
java.lang.Class<?> handlerType)
RequestMappingOverride annotationnull if the method does not have a @RequestMapping
annotation or mapping was overridden by RequestMappingOverride annotation.protected boolean isRequestMappingOverridden(RequestMappingInfo mapping,
java.lang.reflect.Method method)
protected boolean hasRequestMappingOverrideAnnotation(java.lang.reflect.Method method)
RequestMappingOverride annotationprotected java.lang.Integer getMethodPriorityValue(java.lang.reflect.Method method)
RequestMappingOverride annotation. Priority value is read from
properties files (project.properties, local.properties). If there is no priorityProperty then
<className>.<methodName>.priority will be used as property name. If there is no value for property with
given name, default value = 0 will be returned.protected void initOverridenRequestMappings()
protected void detectOverriddenMappings(java.lang.Object handler)
handler - the bean name of a handler or a handler instanceprotected void registerOverriddenMapping(java.lang.reflect.Method method,
RequestMappingInfo mapping)
public void setDetectHandlerMethodsInAncestorContexts(boolean detectHandlerMethodsInAncestorContexts)
public java.util.Map<RequestMappingInfo,java.lang.Integer> getOverriddenRequestMapping()
public int getDefaultRequestMappingOverridePriority()
public void setDefaultRequestMappingOverridePriority(int defaultRequestMappingOverridePriority)
Copyright © 2018 SAP SE. All Rights Reserved.