Repository: incubator-freemarker Updated Branches: refs/heads/3 3dc00fb8b -> a93023c76
JavaDoc content fixes/improvements Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/6457c9dd Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/6457c9dd Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/6457c9dd Branch: refs/heads/3 Commit: 6457c9ddbecca23f1b695cae5f36bbd300752adc Parents: 3dc00fb Author: ddekany <[email protected]> Authored: Wed Jun 7 11:25:24 2017 +0200 Committer: ddekany <[email protected]> Committed: Wed Jun 7 18:30:49 2017 +0200 ---------------------------------------------------------------------- .../freemarker/core/TopLevelConfiguration.java | 40 +++++++++++++------- .../core/templateresolver/TemplateResolver.java | 4 +- .../impl/DefaultTemplateResolver.java | 13 ++----- 3 files changed, 31 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/6457c9dd/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java b/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java index 18e705b..64ae95b 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java @@ -60,8 +60,10 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration * * <p>You can chain several {@link TemplateLoader}-s together with {@link MultiTemplateLoader}. * - * <p>If the {@link #getTemplateResolver() templateResolver} doesn't support this setting, then it must be {@code - * null}. This check is postponed until the {@link Configuration} instance is created. + * <p>If the the {@link #getTemplateResolver() templateResolver} is a {@link DefaultTemplateResolver} then this + * setting is allowed to be {@code null} (however then you won't be able to load any templates). If the class of + * the {@link #getTemplateResolver() templateResolver} is something else that doesn't support this setting, then + * it must be {@code null}. These checks are postponed until the {@link Configuration} instance is created. */ TemplateLoader getTemplateLoader(); @@ -75,8 +77,10 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration * custom lookup condition. Its default is {@link DefaultTemplateLookupStrategy#INSTANCE}, except when the * {@link #getTemplateResolver() templateResolver} doesn't support this setting, in which case it's {@code null}. * - * <p>If the {@link #getTemplateResolver() templateResolver} doesn't support this setting, then it must be {@code - * null}. This check is postponed until the {@link Configuration} instance is created. + * <p>If the the {@link #getTemplateResolver() templateResolver} is a {@link DefaultTemplateResolver} then this + * setting must not be {@code null}. If the class of the {@link #getTemplateResolver() templateResolver} is + * something else that doesn't support this setting, then it must be {@code null}. These checks are postponed until + * the {@link Configuration} instance is created. */ TemplateLookupStrategy getTemplateLookupStrategy(); @@ -91,8 +95,10 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration * {@link DefaultTemplateNameFormat#INSTANCE}), except when the {@link #getTemplateResolver() templateResolver} * doesn't support this setting, in which case it's {@code null}. * - * <p>If the {@link #getTemplateResolver() templateResolver} doesn't support this setting, then it must be {@code - * null}. This check is postponed until the {@link Configuration} instance is created. + * <p>If the the {@link #getTemplateResolver() templateResolver} is a {@link DefaultTemplateResolver} then this + * setting must not be {@code null}. If the class of the {@link #getTemplateResolver() templateResolver} is + * something else that doesn't support this setting, then it must be {@code null}. These checks are postponed until + * the {@link Configuration} instance is created. */ TemplateNameFormat getTemplateNameFormat(); @@ -112,8 +118,10 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration * <p> * See "Template configurations" in the FreeMarker Manual for examples. * - * <p>If the {@link #getTemplateResolver() templateResolver} doesn't support this setting, then it must be {@code - * null}. This check is postponed until the {@link Configuration} instance is created. + * <p>If the the {@link #getTemplateResolver() templateResolver} is a {@link DefaultTemplateResolver} then this + * is allowed to be {@code null}. If the class of the {@link #getTemplateResolver() templateResolver} is + * something else that doesn't support this setting, then it must be {@code null}. These checks are postponed + * until the {@link Configuration} instance is created. */ TemplateConfigurationFactory getTemplateConfigurations(); @@ -127,8 +135,10 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration * {@link Template} objects. The default is a {@link SoftCacheStorage}, except when the * {@link #getTemplateResolver() templateResolver} doesn't support this setting, in which case it's {@code null}. * - * <p>If the {@link #getTemplateResolver() templateResolver} doesn't support this setting, then it must be {@code - * null}. This check is postponed until the {@link Configuration} instance is created. + * <p>If the the {@link #getTemplateResolver() templateResolver} is a {@link DefaultTemplateResolver} then this + * setting must not be {@code null}. If the class of the {@link #getTemplateResolver() templateResolver} is + * something else that doesn't support this setting, then it must be {@code null}. These checks are postponed until + * the {@link Configuration} instance is created. */ CacheStorage getCacheStorage(); @@ -142,8 +152,10 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration * "file" than the cached one. The defaults is 5000 ms, except when the * {@link #getTemplateResolver() templateResolver} doesn't support this setting, in which case it's {@code null}. * - * <p>If the {@link #getTemplateResolver() templateResolver} doesn't support this setting, then it must be {@code - * null}. This check is postponed until the {@link Configuration} instance is created. + * <p>If the the {@link #getTemplateResolver() templateResolver} is a {@link DefaultTemplateResolver} then this + * setting must not be {@code null}. If the class of the {@link #getTemplateResolver() templateResolver} is + * something else that doesn't support this setting, then it must be {@code null}. These checks are postponed until + * the {@link Configuration} instance is created. */ Long getTemplateUpdateDelayMilliseconds(); @@ -186,7 +198,7 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration Version getIncompatibleImprovements(); /** - * Whether localized template lookup is enabled . The default is {@code true}, except when the + * Whether localized template lookup is enabled. The default is {@code true}, except when the * {@link #getTemplateResolver() templateResolver} doesn't support this setting, in which case it's {@code null}. * <p> * With the default {@link TemplateLookupStrategy}, localized lookup works like this: Let's say your locale setting @@ -198,7 +210,7 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration * {@link #getTemplateLookupStrategy() templateLookupStrategy} setting. * <p> * If the {@link #getTemplateResolver() templateResolver} doesn't support this setting, then it must be {@code - * null}. This check is postponed until the {@link Configuration} instance is created. + * null}. These checks are postponed until the {@link Configuration} instance is created. */ Boolean getLocalizedLookup(); http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/6457c9dd/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java index de70101..fe4a077 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java @@ -40,8 +40,8 @@ import org.apache.freemarker.core.util._NullArgumentException; * {@link DefaultTemplateResolver} depends on. These settings are collected into the * {@link TemplateResolverDependencies} class, and the {@link TemplateResolver} should get them in {@link #initialize()} * via {@link #getDependencies()}. It's possible that the custom {@link TemplateResolver} only uses some of these - * settings, which should be reflected by the return value of the {@code supportsXxxDependency} methods (like - * {@link #supportsTemplateLoaderSetting()}). (Note that there's no {@code supportsXxxDependency} method for + * settings, which should be reflected by the return value of the {@code supportsXxxSetting} methods (like + * {@link #supportsTemplateLoaderSetting()}). (Note that there's no {@code supportsXxxSetting} method for * {@link Configuration#getTemplateLanguage() templateLanguage} and {@link Configuration#getSourceEncoding() * sourceEncoding} and these settings are always exposed.) {@link TemplateResolverDependencies} will also expose the * {@link TemplateResolverDependencies#parse} method, which is used to create a {@link Template} from its source code. http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/6457c9dd/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java index a4ac768..1ff38be 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java @@ -64,16 +64,9 @@ import org.apache.freemarker.core.util._StringUtil; import org.slf4j.Logger; /** - * Performs caching and on-demand loading of the templates. - * The actual template "file" loading is delegated to a {@link TemplateLoader} that you can specify in the constructor. - * Some aspects of caching is delegated to a {@link CacheStorage} that you can also specify in the constructor. - * - * <p>Typically you don't instantiate or otherwise use this class directly. By default the {@link Configuration} embeds - * an instance of this class, that you access indirectly through {@link Configuration#getTemplate(String)} and other - * {@link Configuration} API-s. When you set the {@link Configuration#getTemplateLoader() templateLoader} or - * {@link Configuration#getCacheStorage() cacheStorage} of the {@link Configuration}, you indirectly configure the - * {@link TemplateResolver}. - */ + * The default implementation of the {@link TemplateResolver} class; the default value of + * {@link Configuration#getTemplateResolver() templateResolver} configuration setting is an instance of this. + */ public class DefaultTemplateResolver extends TemplateResolver { /**
