Skip to content

Commit d1d9d48

Browse files
committed
Document @⁠HttpExchange support in RequestMappingHandlerMapping
1 parent 375e0e6 commit d1d9d48

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@
5555

5656
/**
5757
* An extension of {@link RequestMappingInfoHandlerMapping} that creates
58-
* {@link RequestMappingInfo} instances from class-level and method-level
59-
* {@link RequestMapping @RequestMapping} annotations.
58+
* {@link RequestMappingInfo} instances from type-level and method-level
59+
* {@link RequestMapping @RequestMapping} and {@link HttpExchange @HttpExchange}
60+
* annotations.
6061
*
6162
* @author Rossen Stoyanchev
6263
* @author Sam Brannen
@@ -84,9 +85,9 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
8485
/**
8586
* Configure path prefixes to apply to controller methods.
8687
* <p>Prefixes are used to enrich the mappings of every {@code @RequestMapping}
87-
* method whose controller type is matched by a corresponding
88-
* {@code Predicate} in the map. The prefix for the first matching predicate
89-
* is used, assuming the input map has predictable order.
88+
* method and {@code @HttpExchange} method whose controller type is matched
89+
* by a corresponding {@code Predicate} in the map. The prefix for the first
90+
* matching predicate is used, assuming the input map has predictable order.
9091
* <p>Consider using {@link org.springframework.web.method.HandlerTypePredicate
9192
* HandlerTypePredicate} to group controllers.
9293
* @param prefixes a map with path prefixes as key
@@ -149,10 +150,11 @@ protected boolean isHandler(Class<?> beanType) {
149150
}
150151

151152
/**
152-
* Uses method and type-level @{@link RequestMapping} annotations to create
153-
* the RequestMappingInfo.
154-
* @return the created RequestMappingInfo, or {@code null} if the method
155-
* does not have a {@code @RequestMapping} annotation.
153+
* Uses type-level and method-level {@link RequestMapping @RequestMapping}
154+
* and {@link HttpExchange @HttpExchange} annotations to create the
155+
* {@link RequestMappingInfo}.
156+
* @return the created {@code RequestMappingInfo}, or {@code null} if the method
157+
* does not have a {@code @RequestMapping} or {@code @HttpExchange} annotation
156158
* @see #getCustomMethodCondition(Method)
157159
* @see #getCustomTypeCondition(Class)
158160
*/
@@ -214,7 +216,7 @@ private RequestMappingInfo createRequestMappingInfo(AnnotatedElement element) {
214216

215217
/**
216218
* Protected method to provide a custom type-level request condition.
217-
* The custom {@link RequestCondition} can be of any type so long as the
219+
* <p>The custom {@link RequestCondition} can be of any type so long as the
218220
* same condition type is returned from all calls to this method in order
219221
* to ensure custom request conditions can be combined and compared.
220222
* <p>Consider extending
@@ -233,7 +235,7 @@ protected RequestCondition<?> getCustomTypeCondition(Class<?> handlerType) {
233235

234236
/**
235237
* Protected method to provide a custom method-level request condition.
236-
* The custom {@link RequestCondition} can be of any type so long as the
238+
* <p>The custom {@link RequestCondition} can be of any type so long as the
237239
* same condition type is returned from all calls to this method in order
238240
* to ensure custom request conditions can be combined and compared.
239241
* <p>Consider extending
@@ -252,7 +254,7 @@ protected RequestCondition<?> getCustomMethodCondition(Method method) {
252254

253255
/**
254256
* Create a {@link RequestMappingInfo} from the supplied
255-
* {@link RequestMapping @RequestMapping} annotation, or meta-annotation,
257+
* {@link RequestMapping @RequestMapping} annotation, meta-annotation,
256258
* or synthesized result of merging annotation attributes within an
257259
* annotation hierarchy.
258260
*/
@@ -277,7 +279,7 @@ protected RequestMappingInfo createRequestMappingInfo(
277279

278280
/**
279281
* Create a {@link RequestMappingInfo} from the supplied
280-
* {@link HttpExchange @HttpExchange} annotation, or meta-annotation,
282+
* {@link HttpExchange @HttpExchange} annotation, meta-annotation,
281283
* or synthesized result of merging annotation attributes within an
282284
* annotation hierarchy.
283285
* @since 6.1

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
import org.springframework.web.util.pattern.PathPatternParser;
6262

6363
/**
64-
* Creates {@link RequestMappingInfo} instances from type and method-level
65-
* {@link RequestMapping @RequestMapping} annotations in
66-
* {@link Controller @Controller} classes.
64+
* Creates {@link RequestMappingInfo} instances from type-level and method-level
65+
* {@link RequestMapping @RequestMapping} and {@link HttpExchange @HttpExchange}
66+
* annotations in {@link Controller @Controller} classes.
6767
*
6868
* <p><strong>Deprecation Note:</strong></p> In 5.2.4,
6969
* {@link #setUseSuffixPatternMatch(boolean) useSuffixPatternMatch} and
@@ -168,8 +168,9 @@ public void setUseTrailingSlashMatch(boolean useTrailingSlashMatch) {
168168
/**
169169
* Configure path prefixes to apply to controller methods.
170170
* <p>Prefixes are used to enrich the mappings of every {@code @RequestMapping}
171-
* method whose controller type is matched by the corresponding
172-
* {@code Predicate}. The prefix for the first matching predicate is used.
171+
* method and {@code @HttpExchange} method whose controller type is matched
172+
* by a corresponding {@code Predicate} in the map. The prefix for the first
173+
* matching predicate is used, assuming the input map has predictable order.
173174
* <p>Consider using {@link org.springframework.web.method.HandlerTypePredicate
174175
* HandlerTypePredicate} to group controllers.
175176
* @param prefixes a map with path prefixes as key
@@ -278,7 +279,7 @@ public List<String> getFileExtensions() {
278279
}
279280

280281
/**
281-
* Obtain a {@link RequestMappingInfo.BuilderConfiguration} that can reflects
282+
* Obtain a {@link RequestMappingInfo.BuilderConfiguration} that reflects
282283
* the internal configuration of this {@code HandlerMapping} and can be used
283284
* to set {@link RequestMappingInfo.Builder#options(RequestMappingInfo.BuilderConfiguration)}.
284285
* <p>This is useful for programmatic registration of request mappings via
@@ -301,10 +302,11 @@ protected boolean isHandler(Class<?> beanType) {
301302
}
302303

303304
/**
304-
* Uses method and type-level @{@link RequestMapping} annotations to create
305-
* the RequestMappingInfo.
306-
* @return the created RequestMappingInfo, or {@code null} if the method
307-
* does not have a {@code @RequestMapping} annotation.
305+
* Uses type-level and method-level {@link RequestMapping @RequestMapping}
306+
* and {@link HttpExchange @HttpExchange} annotations to create the
307+
* {@link RequestMappingInfo}.
308+
* @return the created {@code RequestMappingInfo}, or {@code null} if the method
309+
* does not have a {@code @RequestMapping} or {@code @HttpExchange} annotation
308310
* @see #getCustomMethodCondition(Method)
309311
* @see #getCustomTypeCondition(Class)
310312
*/
@@ -406,7 +408,7 @@ protected RequestCondition<?> getCustomMethodCondition(Method method) {
406408

407409
/**
408410
* Create a {@link RequestMappingInfo} from the supplied
409-
* {@link RequestMapping @RequestMapping} annotation, or meta-annotation,
411+
* {@link RequestMapping @RequestMapping} annotation, meta-annotation,
410412
* or synthesized result of merging annotation attributes within an
411413
* annotation hierarchy.
412414
*/
@@ -431,7 +433,7 @@ protected RequestMappingInfo createRequestMappingInfo(
431433

432434
/**
433435
* Create a {@link RequestMappingInfo} from the supplied
434-
* {@link HttpExchange @HttpExchange} annotation, or meta-annotation,
436+
* {@link HttpExchange @HttpExchange} annotation, meta-annotation,
435437
* or synthesized result of merging annotation attributes within an
436438
* annotation hierarchy.
437439
* @since 6.1

0 commit comments

Comments
 (0)