@@ -71,13 +71,20 @@ protected AbstractHttpMessageConverter(MediaType supportedMediaType) {
7171 }
7272
7373 /**
74- * Construct an {@code AbstractHttpMessageConverter} with multiple supported media type .
74+ * Construct an {@code AbstractHttpMessageConverter} with multiple supported media types .
7575 * @param supportedMediaTypes the supported media types
7676 */
7777 protected AbstractHttpMessageConverter (MediaType ... supportedMediaTypes ) {
7878 setSupportedMediaTypes (Arrays .asList (supportedMediaTypes ));
7979 }
8080
81+ /**
82+ * Construct an {@code AbstractHttpMessageConverter} with a default charset and
83+ * multiple supported media types.
84+ * @param defaultCharset the default character set
85+ * @param supportedMediaTypes the supported media types
86+ * @since 4.3
87+ */
8188 protected AbstractHttpMessageConverter (Charset defaultCharset , MediaType ... supportedMediaTypes ) {
8289 this .defaultCharset = defaultCharset ;
8390 setSupportedMediaTypes (Arrays .asList (supportedMediaTypes ));
@@ -98,16 +105,22 @@ public List<MediaType> getSupportedMediaTypes() {
98105 }
99106
100107 /**
101- * Set the default character set if any.
108+ * Set the default character set, if any.
109+ * @since 4.3
102110 */
103111 public void setDefaultCharset (Charset defaultCharset ) {
104112 this .defaultCharset = defaultCharset ;
105113 }
106114
115+ /**
116+ * Return the default character set, if any.
117+ * @since 4.3
118+ */
107119 public Charset getDefaultCharset () {
108- return defaultCharset ;
120+ return this . defaultCharset ;
109121 }
110122
123+
111124 /**
112125 * This implementation checks if the given class is {@linkplain #supports(Class) supported},
113126 * and if the {@linkplain #getSupportedMediaTypes() supported media types}
@@ -119,7 +132,7 @@ public boolean canRead(Class<?> clazz, MediaType mediaType) {
119132 }
120133
121134 /**
122- * Returns true if any of the {@linkplain #setSupportedMediaTypes(List)
135+ * Returns {@code true} if any of the {@linkplain #setSupportedMediaTypes(List)
123136 * supported} media types {@link MediaType#includes(MediaType) include} the
124137 * given media type.
125138 * @param mediaType the media type to read, can be {@code null} if not specified.
0 commit comments