Skip to content

Commit

Permalink
Add an AbstractGenericHttpMessageConverter constructor
Browse files Browse the repository at this point in the history
This commit adds a new
AbstractGenericHttpMessageConverter(Charset, MediaType...)
constructor, similar to the one present in
AbstractHttpMessageConverter.

Closes gh-33563
  • Loading branch information
sdeleuze committed Sep 24, 2024
1 parent 5f6b8d5 commit 81a66a0
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Type;
import java.nio.charset.Charset;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpOutputMessage;
Expand Down Expand Up @@ -60,6 +61,17 @@ protected AbstractGenericHttpMessageConverter(MediaType... supportedMediaTypes)
super(supportedMediaTypes);
}

/**
* Construct an {@code AbstractGenericHttpMessageConverter} with a default charset and
* multiple supported media types.
* @param defaultCharset the default character set
* @param supportedMediaTypes the supported media types
* @since 6.2
*/
protected AbstractGenericHttpMessageConverter(Charset defaultCharset, MediaType... supportedMediaTypes) {
super(defaultCharset, supportedMediaTypes);
}


@Override
protected boolean supports(Class<?> clazz) {
Expand Down

0 comments on commit 81a66a0

Please sign in to comment.