Polishing

This commit is contained in:
Juergen Hoeller
2015-07-17 15:25:43 +02:00
parent 7e2a662f63
commit 203f1225c3
6 changed files with 65 additions and 51 deletions

View File

@@ -49,7 +49,6 @@ public abstract class AbstractMessageConverter implements MessageConverter {
* ({@link MethodParameter} instance) about the origin of the payload (for
* {@link #toMessage(Object, MessageHeaders)}) or about the target of the payload
* ({@link #fromMessage(Message, Class)}).
*
* @since 4.2
*/
public static final String METHOD_PARAMETER_HINT_HEADER = "methodParameterHint";
@@ -221,12 +220,7 @@ public abstract class AbstractMessageConverter implements MessageConverter {
}
MimeType mimeType = getMimeType(headers);
if (mimeType == null) {
if (isStrictContentTypeMatch()) {
return false;
}
else {
return true;
}
return !isStrictContentTypeMatch();
}
for (MimeType current : getSupportedMimeTypes()) {
if (current.getType().equals(mimeType.getType()) && current.getSubtype().equals(mimeType.getSubtype())) {

View File

@@ -245,8 +245,8 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
}
private Class<?> getSerializationView(MessageHeaders headers) {
MethodParameter returnType = (headers == null ? null :
(MethodParameter)headers.get(METHOD_PARAMETER_HINT_HEADER));
MethodParameter returnType = (headers != null ?
(MethodParameter) headers.get(METHOD_PARAMETER_HINT_HEADER) : null);
if (returnType == null) {
return null;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 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.
@@ -37,8 +37,8 @@ import org.springframework.validation.Validator;
* The default {@link MessageHandlerMethodFactory} implementation creating an
* {@link InvocableHandlerMethod} with the necessary
* {@link HandlerMethodArgumentResolver} instances to detect and process
* most of the use cases defined by
* {@link org.springframework.messaging.handler.annotation.MessageMapping MessageMapping}
* most of the use cases defined by
* {@link org.springframework.messaging.handler.annotation.MessageMapping MessageMapping}.
*
* <p>Extra method argument resolvers can be added to customize the method
* signature that can be handled.