Browse Source

Polishing

pull/27229/head
Sam Brannen 1 year ago
parent
commit
293e6ddf85
  1. 9
      spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJackson2MessageConverter.java
  2. 10
      spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java

9
spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJackson2MessageConverter.java

@ -44,7 +44,8 @@ import org.springframework.util.ClassUtils; @@ -44,7 +44,8 @@ import org.springframework.util.ClassUtils;
/**
* Message converter that uses Jackson 2.x to convert messages to and from JSON.
* Maps an object to a {@link BytesMessage}, or to a {@link TextMessage} if the
*
* <p>Maps an object to a {@link BytesMessage}, or to a {@link TextMessage} if the
* {@link #setTargetType targetType} is set to {@link MessageType#TEXT}.
* Converts from a {@link TextMessage} or {@link BytesMessage} to an object.
*
@ -100,8 +101,8 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B @@ -100,8 +101,8 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
}
/**
* Construct a {@code MappingJackson2MessageConverter} with a custom {@link ObjectMapper}.
* @param objectMapper the ObjectMapper to use
* Construct a {@code MappingJackson2MessageConverter} with a custom {@link ObjectMapper}.
* @param objectMapper the {@code ObjectMapper} to use
* @since 6.1
*/
public MappingJackson2MessageConverter(ObjectMapper objectMapper) {
@ -112,7 +113,7 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B @@ -112,7 +113,7 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
/**
* Set the {@code ObjectMapper} for this converter.
* If not set, a default {@link ObjectMapper#ObjectMapper() ObjectMapper} is used.
* <p>If not set, a default {@link ObjectMapper#ObjectMapper() ObjectMapper} is used.
*/
public void setObjectMapper(ObjectMapper objectMapper) {
Assert.notNull(objectMapper, "ObjectMapper must not be null");

10
spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java

@ -93,7 +93,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { @@ -93,7 +93,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
/**
* Construct a {@code MappingJackson2MessageConverter} with a custom {@link ObjectMapper},
* supporting the {@code application/json} MIME type with {@code UTF-8} character set.
* @param objectMapper the ObjectMapper to use
* @param objectMapper the {@code ObjectMapper} to use
* @since 6.1
*/
public MappingJackson2MessageConverter(ObjectMapper objectMapper) {
@ -103,7 +103,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { @@ -103,7 +103,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
/**
* Construct a {@code MappingJackson2MessageConverter} with a custom {@link ObjectMapper},
* supporting one or more custom MIME types.
* @param objectMapper the ObjectMapper to use
* @param objectMapper the {@code ObjectMapper} to use
* @param supportedMimeTypes the supported MIME types
* @since 6.1
*/
@ -116,14 +116,14 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { @@ -116,14 +116,14 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
/**
* Set the {@code ObjectMapper} for this converter.
* If not set, a default {@link ObjectMapper#ObjectMapper() ObjectMapper} is used.
* <p>If not set, a default {@link ObjectMapper#ObjectMapper() ObjectMapper} is used.
* <p>Setting a custom-configured {@code ObjectMapper} is one way to take further
* control of the JSON serialization process. For example, an extended
* {@link com.fasterxml.jackson.databind.ser.SerializerFactory} can be
* configured that provides custom serializers for specific types. The other
* option for refining the serialization process is to use Jackson's provided
* annotations on the types to be serialized, in which case a custom-configured
* ObjectMapper is unnecessary.
* {@code ObjectMapper} is unnecessary.
*/
public void setObjectMapper(ObjectMapper objectMapper) {
Assert.notNull(objectMapper, "ObjectMapper must not be null");
@ -140,7 +140,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { @@ -140,7 +140,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
/**
* Whether to use the {@link DefaultPrettyPrinter} when writing JSON.
* This is a shortcut for setting up an {@code ObjectMapper} as follows:
* <p>This is a shortcut for setting up an {@code ObjectMapper} as follows:
* <pre class="code">
* ObjectMapper mapper = new ObjectMapper();
* mapper.configure(SerializationFeature.INDENT_OUTPUT, true);

Loading…
Cancel
Save