Avoid unnecessary GenericHttpMessageConverter re-declaration
This commit is contained in:
parent
570851e8e4
commit
96875fe015
|
@ -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
|
||||||
|
|
||||||
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;
|
||||||
* 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");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue