diff --git a/spring-messaging/src/main/java/org/springframework/messaging/converter/MessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/converter/MessageConverter.java index 89fc91d781e..d86ee9fe2f0 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/converter/MessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/converter/MessageConverter.java @@ -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. @@ -31,11 +31,11 @@ import org.springframework.messaging.MessageHeaders; public interface MessageConverter { /** - * Convert the payload of a {@link Message} from serialized form to a typed Object of - * the specified target class. The {@link MessageHeaders#CONTENT_TYPE} header should - * indicate the MIME type to convert from. - *

If the converter does not support the specified media type or cannot perform the - * conversion, it should return {@code null}. + * Convert the payload of a {@link Message} from a serialized form to a typed Object + * of the specified target class. The {@link MessageHeaders#CONTENT_TYPE} header + * should indicate the MIME type to convert from. + *

If the converter does not support the specified media type or cannot perform + * the conversion, it should return {@code null}. * @param message the input message * @param targetClass the target class for the conversion * @return the result of the conversion, or {@code null} if the converter cannot @@ -47,15 +47,15 @@ public interface MessageConverter { * Create a {@link Message} whose payload is the result of converting the given * payload Object to serialized form. The optional {@link MessageHeaders} parameter * may contain a {@link MessageHeaders#CONTENT_TYPE} header to specify the target - * media type for the conversion and it may contain additional headers to be added to - * the message. - *

If the converter does not support the specified media type or cannot perform the - * conversion, it should return {@code null}. + * media type for the conversion and it may contain additional headers to be added + * to the message. + *

If the converter does not support the specified media type or cannot perform + * the conversion, it should return {@code null}. * @param payload the Object to convert - * @param header optional headers for the message, may be {@code null} - * @return the new message or {@code null} if the converter does not support the + * @param headers optional headers for the message (may be {@code null}) + * @return the new message, or {@code null} if the converter does not support the * Object type or the target media type */ - Message toMessage(Object payload, MessageHeaders header); + Message toMessage(Object payload, MessageHeaders headers); } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java index c8005573d33..953d8715605 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java @@ -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. @@ -46,7 +46,6 @@ public interface SimpMessageSendingOperations extends MessageSendingOperationsBy default headers are interpreted as native headers (e.g. STOMP) and * are saved under a special key in the resulting Spring * {@link org.springframework.messaging.Message Message}. In effect when the * message leaves the application, the provided headers are included with it * and delivered to the destination (e.g. the STOMP client or broker). - * *

If the map already contains the key * {@link org.springframework.messaging.support.NativeMessageHeaderAccessor#NATIVE_HEADERS "nativeHeaders"} * or was prepared with @@ -69,36 +66,31 @@ public interface SimpMessageSendingOperations extends MessageSendingOperations * SimpMessageHeaderAccessor accessor = SimpMessageHeaderAccessor.create(); * accessor.setContentType(MimeTypeUtils.TEXT_PLAIN); * accessor.setNativeHeader("foo", "bar"); * accessor.setLeaveMutable(true); * MessageHeaders headers = accessor.getMessageHeaders(); - * * messagingTemplate.convertAndSendToUser(user, destination, payload, headers); * - * *

Note: if the {@code MessageHeaders} are mutable as in * the above example, implementations of this interface should take notice and * update the headers in the same instance (rather than copy or re-create it) * and then set it immutable before sending the final message. - * - * @param user the user that should receive the message, must not be {@code null} - * @param destination the destination to send the message to, must not be {@code null} - * @param payload the payload to send, may be {@code null} - * @param headers the message headers, may be {@code null} + * @param user the user that should receive the message (must not be {@code null}) + * @param destination the destination to send the message to (must not be {@code null}) + * @param payload the payload to send (may be {@code null}) + * @param headers the message headers (may be {@code null}) */ void convertAndSendToUser(String user, String destination, Object payload, Map headers) throws MessagingException; /** * Send a message to the given user. - * - * @param user the user that should receive the message, must not be {@code null} - * @param destination the destination to send the message to, must not be {@code null} - * @param payload the payload to send, may be {@code null} + * @param user the user that should receive the message (must not be {@code null}) + * @param destination the destination to send the message to (must not be {@code null}) + * @param payload the payload to send (may be {@code null}) * @param postProcessor a postProcessor to post-process or modify the created message */ void convertAndSendToUser(String user, String destination, Object payload, @@ -106,12 +98,10 @@ public interface SimpMessageSendingOperations extends MessageSendingOperationsSee {@link #convertAndSend(Object, Object, java.util.Map)} for important * notes regarding the input headers. - * - * @param user the user that should receive the message. - * @param destination the destination to send the message to. + * @param user the user that should receive the message + * @param destination the destination to send the message to * @param payload the payload to send * @param headers the message headers * @param postProcessor a postProcessor to post-process or modify the created message diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java index b52d8d8adc4..ed3896f3a03 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java @@ -515,7 +515,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran } /** - * Create a rae TransactionStatus instance for the given arguments. + * Create a TransactionStatus instance for the given arguments. */ protected DefaultTransactionStatus newTransactionStatus( TransactionDefinition definition, Object transaction, boolean newTransaction, diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java index e1dd7e34a7d..a374283f724 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java @@ -212,7 +212,7 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener private Object readJavaType(JavaType javaType, HttpInputMessage inputMessage) { try { if (inputMessage instanceof MappingJacksonInputMessage) { - Class deserializationView = ((MappingJacksonInputMessage)inputMessage).getDeserializationView(); + Class deserializationView = ((MappingJacksonInputMessage) inputMessage).getDeserializationView(); if (deserializationView != null) { return this.objectMapper.readerWithView(deserializationView) .withType(javaType).readValue(inputMessage.getBody()); diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonInputMessage.java b/spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonInputMessage.java index 1e6492c77c1..297b942d25c 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonInputMessage.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonInputMessage.java @@ -49,14 +49,6 @@ public class MappingJacksonInputMessage implements HttpInputMessage { } - public void setDeserializationView(Class deserializationView) { - this.deserializationView = deserializationView; - } - - public Class getDeserializationView() { - return deserializationView; - } - @Override public InputStream getBody() throws IOException { return this.body; @@ -67,4 +59,12 @@ public class MappingJacksonInputMessage implements HttpInputMessage { return this.headers; } + public void setDeserializationView(Class deserializationView) { + this.deserializationView = deserializationView; + } + + public Class getDeserializationView() { + return this.deserializationView; + } + }