@@ -144,16 +144,16 @@ public MessageConverter getMessageConverter() {
144
144
}
145
145
146
146
/**
147
- * Configure a {@link ConversionService} to use when resolving method arguments, for
148
- * example message header values.
147
+ * Configure a {@link ConversionService} to use when resolving method arguments,
148
+ * for example message header values.
149
149
* <p>By default an instance of {@link DefaultFormattingConversionService} is used.
150
150
*/
151
151
public void setConversionService (ConversionService conversionService ) {
152
152
this .conversionService = conversionService ;
153
153
}
154
154
155
155
/**
156
- * The configured {@link ConversionService}.
156
+ * Return the configured {@link ConversionService}.
157
157
*/
158
158
public ConversionService getConversionService () {
159
159
return this .conversionService ;
@@ -162,22 +162,22 @@ public ConversionService getConversionService() {
162
162
/**
163
163
* Set the PathMatcher implementation to use for matching destinations
164
164
* against configured destination patterns.
165
- * <p>By default AntPathMatcher is used
165
+ * <p>By default, {@link AntPathMatcher} is used.
166
166
*/
167
167
public void setPathMatcher (PathMatcher pathMatcher ) {
168
168
Assert .notNull (pathMatcher , "PathMatcher must not be null" );
169
169
this .pathMatcher = pathMatcher ;
170
170
}
171
171
172
172
/**
173
- * Return the PathMatcher implementation to use for matching destinations
173
+ * Return the PathMatcher implementation to use for matching destinations.
174
174
*/
175
175
public PathMatcher getPathMatcher () {
176
176
return this .pathMatcher ;
177
177
}
178
178
179
179
/**
180
- * The configured Validator instance
180
+ * Return the configured Validator instance.
181
181
*/
182
182
public Validator getValidator () {
183
183
return this .validator ;
@@ -283,17 +283,17 @@ protected boolean isHandler(Class<?> beanType) {
283
283
@ Override
284
284
protected SimpMessageMappingInfo getMappingForMethod (Method method , Class <?> handlerType ) {
285
285
MessageMapping typeAnnotation = AnnotationUtils .findAnnotation (handlerType , MessageMapping .class );
286
- MessageMapping messageAnnot = AnnotationUtils .findAnnotation (method , MessageMapping .class );
287
- if (messageAnnot != null ) {
288
- SimpMessageMappingInfo result = createMessageMappingCondition (messageAnnot );
286
+ MessageMapping messageAnnotation = AnnotationUtils .findAnnotation (method , MessageMapping .class );
287
+ if (messageAnnotation != null ) {
288
+ SimpMessageMappingInfo result = createMessageMappingCondition (messageAnnotation );
289
289
if (typeAnnotation != null ) {
290
290
result = createMessageMappingCondition (typeAnnotation ).combine (result );
291
291
}
292
292
return result ;
293
293
}
294
- SubscribeMapping subsribeAnnotation = AnnotationUtils .findAnnotation (method , SubscribeMapping .class );
295
- if (subsribeAnnotation != null ) {
296
- SimpMessageMappingInfo result = createSubscribeCondition (subsribeAnnotation );
294
+ SubscribeMapping subscribeAnnotation = AnnotationUtils .findAnnotation (method , SubscribeMapping .class );
295
+ if (subscribeAnnotation != null ) {
296
+ SimpMessageMappingInfo result = createSubscribeCondition (subscribeAnnotation );
297
297
if (typeAnnotation != null ) {
298
298
result = createMessageMappingCondition (typeAnnotation ).combine (result );
299
299
}
@@ -348,11 +348,10 @@ public int compare(SimpMessageMappingInfo info1, SimpMessageMappingInfo info2) {
348
348
protected void handleMatch (SimpMessageMappingInfo mapping , HandlerMethod handlerMethod ,
349
349
String lookupDestination , Message <?> message ) {
350
350
351
- SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor .wrap (message );
352
-
353
351
String matchedPattern = mapping .getDestinationConditions ().getPatterns ().iterator ().next ();
354
352
Map <String , String > vars = getPathMatcher ().extractUriTemplateVariables (matchedPattern , lookupDestination );
355
353
354
+ SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor .wrap (message );
356
355
headers .setHeader (DestinationVariableMethodArgumentResolver .DESTINATION_TEMPLATE_VARIABLES_HEADER , vars );
357
356
message = MessageBuilder .withPayload (message .getPayload ()).setHeaders (headers ).build ();
358
357
0 commit comments