Skip to content

Commit 9fb973d

Browse files
committed
Polish JavaDoc for FreeMarkerView in spring-webflux
See gh-23105
1 parent a4f4ef9 commit 9fb973d

File tree

1 file changed

+19
-20
lines changed
  • spring-webflux/src/main/java/org/springframework/web/reactive/result/view/freemarker

1 file changed

+19
-20
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/result/view/freemarker/FreeMarkerView.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
*
5757
* <p>Depends on a single {@link FreeMarkerConfig} object such as
5858
* {@link FreeMarkerConfigurer} being accessible in the application context.
59-
* Alternatively the FreeMarker configuration can be set directly on this
59+
* Alternatively the FreeMarker {@link Configuration} can be set directly on this
6060
* class via {@link #setConfiguration}.
6161
*
6262
* <p>The {@link #setUrl(String) url} property is the location of the FreeMarker
@@ -92,7 +92,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
9292

9393

9494
/**
95-
* Set the FreeMarker Configuration to be used by this view.
95+
* Set the FreeMarker {@link Configuration} to be used by this view.
9696
* <p>Typically this property is not set directly. Instead a single
9797
* {@link FreeMarkerConfig} is expected in the Spring application context
9898
* which is used to obtain the FreeMarker configuration.
@@ -102,18 +102,18 @@ public void setConfiguration(@Nullable Configuration configuration) {
102102
}
103103

104104
/**
105-
* Return the FreeMarker configuration used by this view.
105+
* Get the FreeMarker {@link Configuration} used by this view.
106106
*/
107107
@Nullable
108108
protected Configuration getConfiguration() {
109109
return this.configuration;
110110
}
111111

112112
/**
113-
* Obtain the FreeMarker configuration for actual use.
113+
* Obtain the FreeMarker {@link Configuration} for actual use.
114114
* @return the FreeMarker configuration (never {@code null})
115-
* @throws IllegalStateException in case of no Configuration object set
116-
* @since 5.0
115+
* @throws IllegalStateException in case of no {@code Configuration} object set
116+
* @see #getConfiguration()
117117
*/
118118
protected Configuration obtainConfiguration() {
119119
Configuration configuration = getConfiguration();
@@ -125,15 +125,15 @@ protected Configuration obtainConfiguration() {
125125
* Set the encoding of the FreeMarker template file.
126126
* <p>By default {@link FreeMarkerConfigurer} sets the default encoding in
127127
* the FreeMarker configuration to "UTF-8". It's recommended to specify the
128-
* encoding in the FreeMarker Configuration rather than per template if all
129-
* your templates share a common encoding.
128+
* encoding in the FreeMarker {@link Configuration} rather than per template
129+
* if all your templates share a common encoding.
130130
*/
131131
public void setEncoding(@Nullable String encoding) {
132132
this.encoding = encoding;
133133
}
134134

135135
/**
136-
* Return the encoding for the FreeMarker template.
136+
* Get the encoding for the FreeMarker template.
137137
*/
138138
@Nullable
139139
protected String getEncoding() {
@@ -147,6 +147,7 @@ protected String getEncoding() {
147147
* <p>Needed for Spring's FreeMarker default macros. Note that this is
148148
* <i>not</i> required for templates that use HTML forms <i>unless</i> you
149149
* wish to take advantage of the Spring helper macros.
150+
* @since 5.2
150151
* @see #SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
151152
*/
152153
public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) {
@@ -164,9 +165,9 @@ public void afterPropertiesSet() throws Exception {
164165
}
165166

166167
/**
167-
* Autodetect a {@link FreeMarkerConfig} object via the ApplicationContext.
168-
* @return the Configuration instance to use for FreeMarkerViews
169-
* @throws BeansException if no Configuration instance could be found
168+
* Autodetect a {@link FreeMarkerConfig} object in the {@code ApplicationContext}.
169+
* @return the {@code FreeMarkerConfig} instance to use for this view
170+
* @throws BeansException if no {@code FreeMarkerConfig} instance could be found
170171
* @see #setConfiguration
171172
*/
172173
protected FreeMarkerConfig autodetectConfiguration() throws BeansException {
@@ -176,7 +177,7 @@ protected FreeMarkerConfig autodetectConfiguration() throws BeansException {
176177
}
177178
catch (NoSuchBeanDefinitionException ex) {
178179
throw new ApplicationContextException(
179-
"Must define a single FreeMarkerConfig bean in this web application context " +
180+
"Must define a single FreeMarkerConfig bean in this application context " +
180181
"(may be inherited): FreeMarkerConfigurer is the usual implementation. " +
181182
"This bean may be given any name.", ex);
182183
}
@@ -276,7 +277,7 @@ private Charset getCharset(@Nullable MediaType mediaType) {
276277
}
277278

278279
/**
279-
* Build a FreeMarker template model for the given model Map.
280+
* Build a FreeMarker template model for the given model map.
280281
* <p>The default implementation builds a {@link SimpleHash}.
281282
* @param model the model to use for rendering
282283
* @param exchange current exchange
@@ -289,8 +290,8 @@ protected SimpleHash getTemplateModel(Map<String, Object> model, ServerWebExchan
289290
}
290291

291292
/**
292-
* Return the configured FreeMarker {@link ObjectWrapper}, or the
293-
* {@link ObjectWrapper#DEFAULT_WRAPPER default wrapper} if none specified.
293+
* Get the configured FreeMarker {@link ObjectWrapper}, or the
294+
* {@linkplain ObjectWrapper#DEFAULT_WRAPPER default wrapper} if none specified.
294295
* @see freemarker.template.Configuration#getObjectWrapper()
295296
*/
296297
protected ObjectWrapper getObjectWrapper() {
@@ -300,10 +301,8 @@ protected ObjectWrapper getObjectWrapper() {
300301
}
301302

302303
/**
303-
* Retrieve the FreeMarker template for the given locale,
304-
* to be rendering by this view.
305-
* <p>By default, the template specified by the "url" bean property
306-
* will be retrieved.
304+
* Get the FreeMarker template for the given locale, to be rendered by this view.
305+
* <p>By default, the template specified by the "url" bean property will be retrieved.
307306
* @param locale the current locale
308307
* @return the FreeMarker template to render
309308
*/

0 commit comments

Comments
 (0)