Polishing

This commit is contained in:
Sam Brannen 2023-09-16 15:25:16 +02:00
parent b05e46d502
commit 293e6ddf85
2 changed files with 10 additions and 9 deletions

View File

@ -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
}
/**
* 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
/**
* 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");

View File

@ -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 {
/**
* 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 {
/**
* 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 {
/**
* 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);