56
56
*
57
57
* <p>Depends on a single {@link FreeMarkerConfig} object such as
58
58
* {@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
60
60
* class via {@link #setConfiguration}.
61
61
*
62
62
* <p>The {@link #setUrl(String) url} property is the location of the FreeMarker
@@ -92,7 +92,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
92
92
93
93
94
94
/**
95
- * Set the FreeMarker Configuration to be used by this view.
95
+ * Set the FreeMarker {@link Configuration} to be used by this view.
96
96
* <p>Typically this property is not set directly. Instead a single
97
97
* {@link FreeMarkerConfig} is expected in the Spring application context
98
98
* which is used to obtain the FreeMarker configuration.
@@ -102,18 +102,18 @@ public void setConfiguration(@Nullable Configuration configuration) {
102
102
}
103
103
104
104
/**
105
- * Return the FreeMarker configuration used by this view.
105
+ * Get the FreeMarker {@link Configuration} used by this view.
106
106
*/
107
107
@ Nullable
108
108
protected Configuration getConfiguration () {
109
109
return this .configuration ;
110
110
}
111
111
112
112
/**
113
- * Obtain the FreeMarker configuration for actual use.
113
+ * Obtain the FreeMarker {@link Configuration} for actual use.
114
114
* @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()
117
117
*/
118
118
protected Configuration obtainConfiguration () {
119
119
Configuration configuration = getConfiguration ();
@@ -125,15 +125,15 @@ protected Configuration obtainConfiguration() {
125
125
* Set the encoding of the FreeMarker template file.
126
126
* <p>By default {@link FreeMarkerConfigurer} sets the default encoding in
127
127
* 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.
130
130
*/
131
131
public void setEncoding (@ Nullable String encoding ) {
132
132
this .encoding = encoding ;
133
133
}
134
134
135
135
/**
136
- * Return the encoding for the FreeMarker template.
136
+ * Get the encoding for the FreeMarker template.
137
137
*/
138
138
@ Nullable
139
139
protected String getEncoding () {
@@ -147,6 +147,7 @@ protected String getEncoding() {
147
147
* <p>Needed for Spring's FreeMarker default macros. Note that this is
148
148
* <i>not</i> required for templates that use HTML forms <i>unless</i> you
149
149
* wish to take advantage of the Spring helper macros.
150
+ * @since 5.2
150
151
* @see #SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
151
152
*/
152
153
public void setExposeSpringMacroHelpers (boolean exposeSpringMacroHelpers ) {
@@ -164,9 +165,9 @@ public void afterPropertiesSet() throws Exception {
164
165
}
165
166
166
167
/**
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
170
171
* @see #setConfiguration
171
172
*/
172
173
protected FreeMarkerConfig autodetectConfiguration () throws BeansException {
@@ -176,7 +177,7 @@ protected FreeMarkerConfig autodetectConfiguration() throws BeansException {
176
177
}
177
178
catch (NoSuchBeanDefinitionException ex ) {
178
179
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 " +
180
181
"(may be inherited): FreeMarkerConfigurer is the usual implementation. " +
181
182
"This bean may be given any name." , ex );
182
183
}
@@ -276,7 +277,7 @@ private Charset getCharset(@Nullable MediaType mediaType) {
276
277
}
277
278
278
279
/**
279
- * Build a FreeMarker template model for the given model Map .
280
+ * Build a FreeMarker template model for the given model map .
280
281
* <p>The default implementation builds a {@link SimpleHash}.
281
282
* @param model the model to use for rendering
282
283
* @param exchange current exchange
@@ -289,8 +290,8 @@ protected SimpleHash getTemplateModel(Map<String, Object> model, ServerWebExchan
289
290
}
290
291
291
292
/**
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.
294
295
* @see freemarker.template.Configuration#getObjectWrapper()
295
296
*/
296
297
protected ObjectWrapper getObjectWrapper () {
@@ -300,10 +301,8 @@ protected ObjectWrapper getObjectWrapper() {
300
301
}
301
302
302
303
/**
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.
307
306
* @param locale the current locale
308
307
* @return the FreeMarker template to render
309
308
*/
0 commit comments