提交 96875fe0 编写于 作者: J Juergen Hoeller

Avoid unnecessary GenericHttpMessageConverter re-declaration

上级 570851e8
...@@ -58,8 +58,7 @@ import org.springframework.util.TypeUtils; ...@@ -58,8 +58,7 @@ import org.springframework.util.TypeUtils;
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @since 4.1 * @since 4.1
*/ */
public abstract class AbstractJackson2HttpMessageConverter extends AbstractGenericHttpMessageConverter<Object> public abstract class AbstractJackson2HttpMessageConverter extends AbstractGenericHttpMessageConverter<Object> {
implements GenericHttpMessageConverter<Object> {
public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
...@@ -71,19 +70,19 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener ...@@ -71,19 +70,19 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener
protected AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper) { protected AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper) {
this.objectMapper = objectMapper; this.objectMapper = objectMapper;
this.setDefaultCharset(DEFAULT_CHARSET); setDefaultCharset(DEFAULT_CHARSET);
} }
protected AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper, MediaType supportedMediaType) { protected AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper, MediaType supportedMediaType) {
super(supportedMediaType); super(supportedMediaType);
this.objectMapper = objectMapper; this.objectMapper = objectMapper;
this.setDefaultCharset(DEFAULT_CHARSET); setDefaultCharset(DEFAULT_CHARSET);
} }
protected AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper, MediaType... supportedMediaTypes) { protected AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper, MediaType... supportedMediaTypes) {
super(supportedMediaTypes); super(supportedMediaTypes);
this.objectMapper = objectMapper; this.objectMapper = objectMapper;
this.setDefaultCharset(DEFAULT_CHARSET); setDefaultCharset(DEFAULT_CHARSET);
} }
......
...@@ -48,15 +48,14 @@ import org.springframework.util.Assert; ...@@ -48,15 +48,14 @@ import org.springframework.util.Assert;
* By default, it supports {@code application/json} and {@code application/*+json} with * By default, it supports {@code application/json} and {@code application/*+json} with
* {@code UTF-8} character set. * {@code UTF-8} character set.
* *
* <p>Tested against Gson 2.3; compatible with Gson 2.0 and higher. * <p>Tested against Gson 2.6; compatible with Gson 2.0 and higher.
* *
* @author Roy Clarkson * @author Roy Clarkson
* @since 4.1 * @since 4.1
* @see #setGson * @see #setGson
* @see #setSupportedMediaTypes * @see #setSupportedMediaTypes
*/ */
public class GsonHttpMessageConverter extends AbstractGenericHttpMessageConverter<Object> public class GsonHttpMessageConverter extends AbstractGenericHttpMessageConverter<Object> {
implements GenericHttpMessageConverter<Object> {
public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册