Skip to content

Commit 81a66a0

Browse files
committed
Add an AbstractGenericHttpMessageConverter constructor
This commit adds a new AbstractGenericHttpMessageConverter(Charset, MediaType...) constructor, similar to the one present in AbstractHttpMessageConverter. Closes gh-33563
1 parent 5f6b8d5 commit 81a66a0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

spring-web/src/main/java/org/springframework/http/converter/AbstractGenericHttpMessageConverter.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.io.IOException;
2020
import java.io.OutputStream;
2121
import java.lang.reflect.Type;
22+
import java.nio.charset.Charset;
2223

2324
import org.springframework.http.HttpHeaders;
2425
import org.springframework.http.HttpOutputMessage;
@@ -60,6 +61,17 @@ protected AbstractGenericHttpMessageConverter(MediaType... supportedMediaTypes)
6061
super(supportedMediaTypes);
6162
}
6263

64+
/**
65+
* Construct an {@code AbstractGenericHttpMessageConverter} with a default charset and
66+
* multiple supported media types.
67+
* @param defaultCharset the default character set
68+
* @param supportedMediaTypes the supported media types
69+
* @since 6.2
70+
*/
71+
protected AbstractGenericHttpMessageConverter(Charset defaultCharset, MediaType... supportedMediaTypes) {
72+
super(defaultCharset, supportedMediaTypes);
73+
}
74+
6375

6476
@Override
6577
protected boolean supports(Class<?> clazz) {

0 commit comments

Comments
 (0)