Polish JavaDoc for FreeMarkerView in spring-webflux

See gh-23105
This commit is contained in:
Sam Brannen 2019-06-12 22:42:29 +03:00
parent a4f4ef9011
commit 9fb973d4f3
1 changed files with 19 additions and 20 deletions

View File

@ -56,7 +56,7 @@ import org.springframework.web.server.ServerWebExchange;
* *
* <p>Depends on a single {@link FreeMarkerConfig} object such as * <p>Depends on a single {@link FreeMarkerConfig} object such as
* {@link FreeMarkerConfigurer} being accessible in the application context. * {@link FreeMarkerConfigurer} being accessible in the application context.
* Alternatively the FreeMarker configuration can be set directly on this * Alternatively the FreeMarker {@link Configuration} can be set directly on this
* class via {@link #setConfiguration}. * class via {@link #setConfiguration}.
* *
* <p>The {@link #setUrl(String) url} property is the location of the FreeMarker * <p>The {@link #setUrl(String) url} property is the location of the FreeMarker
@ -92,7 +92,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
/** /**
* Set the FreeMarker Configuration to be used by this view. * Set the FreeMarker {@link Configuration} to be used by this view.
* <p>Typically this property is not set directly. Instead a single * <p>Typically this property is not set directly. Instead a single
* {@link FreeMarkerConfig} is expected in the Spring application context * {@link FreeMarkerConfig} is expected in the Spring application context
* which is used to obtain the FreeMarker configuration. * which is used to obtain the FreeMarker configuration.
@ -102,7 +102,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
} }
/** /**
* Return the FreeMarker configuration used by this view. * Get the FreeMarker {@link Configuration} used by this view.
*/ */
@Nullable @Nullable
protected Configuration getConfiguration() { protected Configuration getConfiguration() {
@ -110,10 +110,10 @@ public class FreeMarkerView extends AbstractUrlBasedView {
} }
/** /**
* Obtain the FreeMarker configuration for actual use. * Obtain the FreeMarker {@link Configuration} for actual use.
* @return the FreeMarker configuration (never {@code null}) * @return the FreeMarker configuration (never {@code null})
* @throws IllegalStateException in case of no Configuration object set * @throws IllegalStateException in case of no {@code Configuration} object set
* @since 5.0 * @see #getConfiguration()
*/ */
protected Configuration obtainConfiguration() { protected Configuration obtainConfiguration() {
Configuration configuration = getConfiguration(); Configuration configuration = getConfiguration();
@ -125,15 +125,15 @@ public class FreeMarkerView extends AbstractUrlBasedView {
* Set the encoding of the FreeMarker template file. * Set the encoding of the FreeMarker template file.
* <p>By default {@link FreeMarkerConfigurer} sets the default encoding in * <p>By default {@link FreeMarkerConfigurer} sets the default encoding in
* the FreeMarker configuration to "UTF-8". It's recommended to specify the * the FreeMarker configuration to "UTF-8". It's recommended to specify the
* encoding in the FreeMarker Configuration rather than per template if all * encoding in the FreeMarker {@link Configuration} rather than per template
* your templates share a common encoding. * if all your templates share a common encoding.
*/ */
public void setEncoding(@Nullable String encoding) { public void setEncoding(@Nullable String encoding) {
this.encoding = encoding; this.encoding = encoding;
} }
/** /**
* Return the encoding for the FreeMarker template. * Get the encoding for the FreeMarker template.
*/ */
@Nullable @Nullable
protected String getEncoding() { protected String getEncoding() {
@ -147,6 +147,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
* <p>Needed for Spring's FreeMarker default macros. Note that this is * <p>Needed for Spring's FreeMarker default macros. Note that this is
* <i>not</i> required for templates that use HTML forms <i>unless</i> you * <i>not</i> required for templates that use HTML forms <i>unless</i> you
* wish to take advantage of the Spring helper macros. * wish to take advantage of the Spring helper macros.
* @since 5.2
* @see #SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE * @see #SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
*/ */
public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) { public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) {
@ -164,9 +165,9 @@ public class FreeMarkerView extends AbstractUrlBasedView {
} }
/** /**
* Autodetect a {@link FreeMarkerConfig} object via the ApplicationContext. * Autodetect a {@link FreeMarkerConfig} object in the {@code ApplicationContext}.
* @return the Configuration instance to use for FreeMarkerViews * @return the {@code FreeMarkerConfig} instance to use for this view
* @throws BeansException if no Configuration instance could be found * @throws BeansException if no {@code FreeMarkerConfig} instance could be found
* @see #setConfiguration * @see #setConfiguration
*/ */
protected FreeMarkerConfig autodetectConfiguration() throws BeansException { protected FreeMarkerConfig autodetectConfiguration() throws BeansException {
@ -176,7 +177,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
} }
catch (NoSuchBeanDefinitionException ex) { catch (NoSuchBeanDefinitionException ex) {
throw new ApplicationContextException( throw new ApplicationContextException(
"Must define a single FreeMarkerConfig bean in this web application context " + "Must define a single FreeMarkerConfig bean in this application context " +
"(may be inherited): FreeMarkerConfigurer is the usual implementation. " + "(may be inherited): FreeMarkerConfigurer is the usual implementation. " +
"This bean may be given any name.", ex); "This bean may be given any name.", ex);
} }
@ -276,7 +277,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
} }
/** /**
* Build a FreeMarker template model for the given model Map. * Build a FreeMarker template model for the given model map.
* <p>The default implementation builds a {@link SimpleHash}. * <p>The default implementation builds a {@link SimpleHash}.
* @param model the model to use for rendering * @param model the model to use for rendering
* @param exchange current exchange * @param exchange current exchange
@ -289,8 +290,8 @@ public class FreeMarkerView extends AbstractUrlBasedView {
} }
/** /**
* Return the configured FreeMarker {@link ObjectWrapper}, or the * Get the configured FreeMarker {@link ObjectWrapper}, or the
* {@link ObjectWrapper#DEFAULT_WRAPPER default wrapper} if none specified. * {@linkplain ObjectWrapper#DEFAULT_WRAPPER default wrapper} if none specified.
* @see freemarker.template.Configuration#getObjectWrapper() * @see freemarker.template.Configuration#getObjectWrapper()
*/ */
protected ObjectWrapper getObjectWrapper() { protected ObjectWrapper getObjectWrapper() {
@ -300,10 +301,8 @@ public class FreeMarkerView extends AbstractUrlBasedView {
} }
/** /**
* Retrieve the FreeMarker template for the given locale, * Get the FreeMarker template for the given locale, to be rendered by this view.
* to be rendering by this view. * <p>By default, the template specified by the "url" bean property will be retrieved.
* <p>By default, the template specified by the "url" bean property
* will be retrieved.
* @param locale the current locale * @param locale the current locale
* @return the FreeMarker template to render * @return the FreeMarker template to render
*/ */