Pull WebFlux getMappingPathPatterns() implementation up in the hierarchy
This commit moves the WebFlux getMappingPathPatterns() implementation from RequestMappingHandlerMapping to RequestMappingInfoHandlerMapping so that subclasses of the latter no longer need to re-implement the method. See gh-22543
This commit is contained in:
parent
dc14ea86eb
commit
85f05023c6
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -50,6 +50,7 @@ import org.springframework.web.util.pattern.PathPattern;
|
|||
* the mapping between a request and a handler method.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Sam Brannen
|
||||
* @since 5.0
|
||||
*/
|
||||
public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMethodMapping<RequestMappingInfo> {
|
||||
|
@ -67,6 +68,15 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the URL path patterns associated with the supplied {@link RequestMappingInfo}.
|
||||
* @since 5.2
|
||||
*/
|
||||
@Override
|
||||
protected Set<PathPattern> getMappingPathPatterns(RequestMappingInfo info) {
|
||||
return info.getPatternsCondition().getPatterns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given RequestMappingInfo matches the current request and
|
||||
* return a (potentially new) instance with conditions that match the
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.lang.reflect.Method;
|
|||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.springframework.context.EmbeddedValueResolverAware;
|
||||
|
@ -42,7 +41,6 @@ import org.springframework.web.reactive.accept.RequestedContentTypeResolverBuild
|
|||
import org.springframework.web.reactive.result.condition.RequestCondition;
|
||||
import org.springframework.web.reactive.result.method.RequestMappingInfo;
|
||||
import org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping;
|
||||
import org.springframework.web.util.pattern.PathPattern;
|
||||
|
||||
/**
|
||||
* An extension of {@link RequestMappingInfoHandlerMapping} that creates
|
||||
|
@ -164,15 +162,6 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
|||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL path patterns associated with the supplied {@link RequestMappingInfo}.
|
||||
* @since 5.2
|
||||
*/
|
||||
@Override
|
||||
protected Set<PathPattern> getMappingPathPatterns(RequestMappingInfo info) {
|
||||
return info.getPatternsCondition().getPatterns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegates to {@link #createRequestMappingInfo(RequestMapping, RequestCondition)},
|
||||
* supplying the appropriate custom {@link RequestCondition} depending on whether
|
||||
|
|
|
@ -477,11 +477,6 @@ public class RequestMappingInfoHandlerMappingTests {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<PathPattern> getMappingPathPatterns(RequestMappingInfo info) {
|
||||
return info.getPatternsCondition().getPatterns();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue