Polish naming for Charset setters in FreeMarker support

See gh-33102
This commit is contained in:
Sam Brannen
2024-06-26 17:51:11 +02:00
parent 08112963a2
commit 95887c81b9
6 changed files with 20 additions and 20 deletions

View File

@@ -69,7 +69,7 @@ public class FreeMarkerConfigurer extends FreeMarkerConfigurationFactory
public FreeMarkerConfigurer() {
setDefaultEncoding(StandardCharsets.UTF_8);
setDefaultCharset(StandardCharsets.UTF_8);
}

View File

@@ -167,7 +167,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
* process. See the note in the {@linkplain FreeMarkerView class-level
* documentation} for details.
* @see freemarker.template.Configuration#setDefaultEncoding
* @see #setEncoding(Charset)
* @see #setCharset(Charset)
* @see #getEncoding()
*/
public void setEncoding(@Nullable String encoding) {
@@ -175,14 +175,14 @@ public class FreeMarkerView extends AbstractUrlBasedView {
}
/**
* Set the encoding used to decode byte sequences to character sequences when
* reading the FreeMarker template file for this view.
* Set the {@link Charset} used to decode byte sequences to character sequences
* when reading the FreeMarker template file for this view.
* <p>See {@link #setEncoding(String)} for details.
* @since 6.2
* @see java.nio.charset.StandardCharsets
*/
public void setEncoding(@Nullable Charset encoding) {
setEncoding(encoding != null ? encoding.name() : null);
public void setCharset(@Nullable Charset charset) {
this.encoding = (charset != null ? charset.name() : null);
}
/**

View File

@@ -135,7 +135,7 @@ class WebFluxViewResolutionIntegrationTests {
public FreeMarkerConfigurer freeMarkerConfigurer() {
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
configurer.setPreTemplateLoaders(classTemplateLoader);
configurer.setDefaultEncoding(UTF_8);
configurer.setDefaultCharset(UTF_8);
return configurer;
}
}
@@ -158,7 +158,7 @@ class WebFluxViewResolutionIntegrationTests {
public FreeMarkerConfigurer freeMarkerConfigurer() {
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
configurer.setPreTemplateLoaders(classTemplateLoader);
configurer.setDefaultEncoding(ISO_8859_1);
configurer.setDefaultCharset(ISO_8859_1);
return configurer;
}