mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-05-03 04:19:47 +01:00
Polish naming for Charset setters in FreeMarker support
See gh-33102
This commit is contained in:
+5
-5
@@ -158,15 +158,15 @@ public class FreeMarkerConfigurationFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the default encoding for the FreeMarker {@link Configuration}, which
|
* Set the {@link Charset} for the default encoding for the FreeMarker
|
||||||
* is used to decode byte sequences to character sequences when reading template
|
* {@link Configuration}, which is used to decode byte sequences to character
|
||||||
* files.
|
* sequences when reading template files.
|
||||||
* <p>See {@link #setDefaultEncoding(String)} for details.
|
* <p>See {@link #setDefaultEncoding(String)} for details.
|
||||||
* @since 6.2
|
* @since 6.2
|
||||||
* @see java.nio.charset.StandardCharsets
|
* @see java.nio.charset.StandardCharsets
|
||||||
*/
|
*/
|
||||||
public void setDefaultEncoding(Charset defaultEncoding) {
|
public void setDefaultCharset(Charset defaultCharset) {
|
||||||
setDefaultEncoding(defaultEncoding.name());
|
this.defaultEncoding = defaultCharset.name();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ public class FreeMarkerConfigurer extends FreeMarkerConfigurationFactory
|
|||||||
|
|
||||||
|
|
||||||
public FreeMarkerConfigurer() {
|
public FreeMarkerConfigurer() {
|
||||||
setDefaultEncoding(StandardCharsets.UTF_8);
|
setDefaultCharset(StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -167,7 +167,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
|
|||||||
* process. See the note in the {@linkplain FreeMarkerView class-level
|
* process. See the note in the {@linkplain FreeMarkerView class-level
|
||||||
* documentation} for details.
|
* documentation} for details.
|
||||||
* @see freemarker.template.Configuration#setDefaultEncoding
|
* @see freemarker.template.Configuration#setDefaultEncoding
|
||||||
* @see #setEncoding(Charset)
|
* @see #setCharset(Charset)
|
||||||
* @see #getEncoding()
|
* @see #getEncoding()
|
||||||
*/
|
*/
|
||||||
public void setEncoding(@Nullable String encoding) {
|
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
|
* Set the {@link Charset} used to decode byte sequences to character sequences
|
||||||
* reading the FreeMarker template file for this view.
|
* when reading the FreeMarker template file for this view.
|
||||||
* <p>See {@link #setEncoding(String)} for details.
|
* <p>See {@link #setEncoding(String)} for details.
|
||||||
* @since 6.2
|
* @since 6.2
|
||||||
* @see java.nio.charset.StandardCharsets
|
* @see java.nio.charset.StandardCharsets
|
||||||
*/
|
*/
|
||||||
public void setEncoding(@Nullable Charset encoding) {
|
public void setCharset(@Nullable Charset charset) {
|
||||||
setEncoding(encoding != null ? encoding.name() : null);
|
this.encoding = (charset != null ? charset.name() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
-2
@@ -135,7 +135,7 @@ class WebFluxViewResolutionIntegrationTests {
|
|||||||
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
||||||
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
||||||
configurer.setPreTemplateLoaders(classTemplateLoader);
|
configurer.setPreTemplateLoaders(classTemplateLoader);
|
||||||
configurer.setDefaultEncoding(UTF_8);
|
configurer.setDefaultCharset(UTF_8);
|
||||||
return configurer;
|
return configurer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ class WebFluxViewResolutionIntegrationTests {
|
|||||||
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
||||||
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
||||||
configurer.setPreTemplateLoaders(classTemplateLoader);
|
configurer.setPreTemplateLoaders(classTemplateLoader);
|
||||||
configurer.setDefaultEncoding(ISO_8859_1);
|
configurer.setDefaultCharset(ISO_8859_1);
|
||||||
return configurer;
|
return configurer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -116,7 +116,7 @@ public class FreeMarkerView extends AbstractTemplateView {
|
|||||||
* process. See the note in the {@linkplain FreeMarkerView class-level
|
* process. See the note in the {@linkplain FreeMarkerView class-level
|
||||||
* documentation} for details.
|
* documentation} for details.
|
||||||
* @see freemarker.template.Configuration#setDefaultEncoding
|
* @see freemarker.template.Configuration#setDefaultEncoding
|
||||||
* @see #setEncoding(Charset)
|
* @see #setCharset(Charset)
|
||||||
* @see #getEncoding()
|
* @see #getEncoding()
|
||||||
* @see #setContentType(String)
|
* @see #setContentType(String)
|
||||||
*/
|
*/
|
||||||
@@ -125,14 +125,14 @@ public class FreeMarkerView extends AbstractTemplateView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the encoding used to decode byte sequences to character sequences when
|
* Set the {@link Charset} used to decode byte sequences to character sequences
|
||||||
* reading the FreeMarker template file for this view.
|
* when reading the FreeMarker template file for this view.
|
||||||
* <p>See {@link #setEncoding(String)} for details.
|
* <p>See {@link #setEncoding(String)} for details.
|
||||||
* @since 6.2
|
* @since 6.2
|
||||||
* @see java.nio.charset.StandardCharsets
|
* @see java.nio.charset.StandardCharsets
|
||||||
*/
|
*/
|
||||||
public void setEncoding(@Nullable Charset encoding) {
|
public void setCharset(@Nullable Charset charset) {
|
||||||
setEncoding(encoding != null ? encoding.name() : null);
|
this.encoding = (charset != null ? charset.name() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
-2
@@ -164,7 +164,7 @@ class ViewResolutionIntegrationTests {
|
|||||||
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
||||||
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
||||||
configurer.setTemplateLoaderPath("/WEB-INF/");
|
configurer.setTemplateLoaderPath("/WEB-INF/");
|
||||||
configurer.setDefaultEncoding(UTF_8);
|
configurer.setDefaultCharset(UTF_8);
|
||||||
return configurer;
|
return configurer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ class ViewResolutionIntegrationTests {
|
|||||||
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
||||||
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
||||||
configurer.setTemplateLoaderPath("/WEB-INF/");
|
configurer.setTemplateLoaderPath("/WEB-INF/");
|
||||||
configurer.setDefaultEncoding(UTF_8);
|
configurer.setDefaultCharset(UTF_8);
|
||||||
return configurer;
|
return configurer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user