Repository: incubator-freemarker Updated Branches: refs/heads/3 24673a17b -> ea2a285c9
(Outdated JavaDoc and error messages: custom attribute -> custom setting) Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/ea2a285c Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/ea2a285c Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/ea2a285c Branch: refs/heads/3 Commit: ea2a285c9650b0e34355386d3e60e7fa72de2e58 Parents: 24673a1 Author: ddekany <[email protected]> Authored: Sat Jun 3 13:51:24 2017 +0200 Committer: ddekany <[email protected]> Committed: Sat Jun 3 13:51:24 2017 +0200 ---------------------------------------------------------------------- .../TemplateConfigurationFactoryTest.java | 2 +- .../apache/freemarker/core/Configuration.java | 4 +-- .../core/CustomSettingNotSetException.java | 2 +- .../core/MutableProcessingConfiguration.java | 14 ++++---- .../core/ProcessingConfiguration.java | 38 ++++++++++---------- .../org/apache/freemarker/core/Template.java | 4 +-- .../freemarker/servlet/FreemarkerServlet.java | 4 +-- 7 files changed, 34 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea2a285c/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java index 547dedf..c0910d3 100644 --- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java +++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java @@ -181,7 +181,7 @@ public class TemplateConfigurationFactoryTest { for (Serializable attKey: mergedTCAttNames) { if (!containsCustomAttr(attKey, expectedTCs)) { - fail("The asserted TemplateConfiguration contains an unexpected custom attribute: " + attKey); + fail("The asserted TemplateConfiguration contains an unexpected custom setting: " + attKey); } } http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea2a285c/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java b/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java index 4ecb354..9076391 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java @@ -1188,8 +1188,8 @@ public final class Configuration * {@inheritDoc} * <p> * Unlike the other isXxxSet methods of {@link Configuration}, this can return {@code false}, as at least the - * builders in FreeMarker Core can't provide defaults for custom attributes. Note that since - * {@link #getCustomSetting(Serializable)} just returns {@code null} for unset custom attributes, it's usually not a + * builders in FreeMarker Core can't provide defaults for custom settings. Note that since + * {@link #getCustomSetting(Serializable)} just returns {@code null} for unset custom settings, it's usually not a * problem. */ @Override http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea2a285c/freemarker-core/src/main/java/org/apache/freemarker/core/CustomSettingNotSetException.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/CustomSettingNotSetException.java b/freemarker-core/src/main/java/org/apache/freemarker/core/CustomSettingNotSetException.java index 180a0fb..743ec36 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/CustomSettingNotSetException.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/CustomSettingNotSetException.java @@ -24,7 +24,7 @@ import java.io.Serializable; import org.apache.freemarker.core.util._StringUtil; /** - * Thrown by {@link ProcessingConfiguration#getCustomSetting(Serializable)} if the custom attribute is not set. + * Thrown by {@link ProcessingConfiguration#getCustomSetting(Serializable)} if the custom setting is not set. */ public class CustomSettingNotSetException extends SettingValueNotSetException { http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea2a285c/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java b/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java index c87a9be..bbdbecf 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java @@ -2129,10 +2129,10 @@ public abstract class MutableProcessingConfiguration<SelfT extends MutableProces * Setter pair of {@link #getCustomSetting(Serializable)}. * * @param key - * The identifier of the the custom attribute; not {@code null}. Usually an enum or a {@link String}. Must + * The identifier of the the custom setting; not {@code null}. Usually an enum or a {@link String}. Must * be usable as {@link HashMap} key. * @param value - * The value of the custom attribute. {@code null} is a legal attribute value. Thus, setting the value to + * The value of the custom setting. {@code null} is a legal attribute value. Thus, setting the value to * {@code null} doesn't unset (remove) the attribute; use {@link #unsetCustomSetting(Serializable)} for * that. Also, {@link #MISSING_VALUE_MARKER} is not an allowed value. * The content of the object shouldn't be changed after it was added as an attribute (ideally, it should @@ -2162,10 +2162,10 @@ public abstract class MutableProcessingConfiguration<SelfT extends MutableProces } /** - * Unset the custom attribute for this {@link ProcessingConfiguration} (but not from the parent + * Unset the custom setting for this {@link ProcessingConfiguration} (but not from the parent * {@link ProcessingConfiguration}, from where it will be possibly inherited after this), as if * {@link #setCustomSetting(Serializable, Object)} was never called for it on this - * {@link ProcessingConfiguration}. Note that this is different than setting the custom attribute value to {@code + * {@link ProcessingConfiguration}. Note that this is different than setting the custom setting value to {@code * null}, as then {@link #getCustomSetting(Serializable)} will just return that {@code null}, and won't look for the * attribute in the parent {@link ProcessingConfiguration}. * @@ -2217,7 +2217,7 @@ public abstract class MutableProcessingConfiguration<SelfT extends MutableProces } /** - * Called from {@link #getCustomSettingsSnapshot(boolean)}, adds the default (such as inherited) custom attributes + * Called from {@link #getCustomSettingsSnapshot(boolean)}, adds the default (such as inherited) custom settings * to the argument {@link Map}. */ protected abstract void collectDefaultCustomSettingsSnapshot(Map<Serializable, Object> target); @@ -2246,7 +2246,7 @@ public abstract class MutableProcessingConfiguration<SelfT extends MutableProces /** * Convenience method for calling {@link #setCustomSetting(Serializable, Object)} for each {@link Map} entry. - * Note that it won't remove the already existing custom attributes. + * Note that it won't remove the already existing custom settings. */ public void setCustomSettings(Map<? extends Serializable, ?> customSettings) { _NullArgumentException.check("customSettings", customSettings); @@ -2279,7 +2279,7 @@ public abstract class MutableProcessingConfiguration<SelfT extends MutableProces } /** - * Unsets all custom attributes which were set in this {@link ProcessingConfiguration} (but doesn't unset + * Unsets all custom settings which were set in this {@link ProcessingConfiguration} (but doesn't unset * those inherited from a parent {@link ProcessingConfiguration}). */ public void unsetAllCustomSettings() { http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea2a285c/freemarker-core/src/main/java/org/apache/freemarker/core/ProcessingConfiguration.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/ProcessingConfiguration.java b/freemarker-core/src/main/java/org/apache/freemarker/core/ProcessingConfiguration.java index 283d9e1..6814967 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/ProcessingConfiguration.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/ProcessingConfiguration.java @@ -51,7 +51,7 @@ public interface ProcessingConfiguration { /** * Useful as the default value parameter to {#getCustomSetting(Serializable, Object)}, because this value is not - * allowed for custom attributes. + * allowed for custom settings. */ Object MISSING_VALUE_MARKER = new Object(); @@ -674,45 +674,45 @@ public interface ProcessingConfiguration { boolean isAutoIncludesSet(); /** - * Retrieves the value of a custom attribute. Custom attributes are key-value pairs associated to a {@link + * Retrieves the value of a custom setting. Custom settings are key-value pairs associated to a {@link * ProcessingConfiguration} object, that the FreeMarker core doesn't try to interpret. They are like configuration - * settings added dynamically (as opposed to in compilation time), where each custom attribute is treated as an + * settings added dynamically (as opposed to in compilation time), where each custom setting is treated as an * individual setting. So where predefined configuration settings used to have {@code isXxxSet}, {@code - * unsetXxx}, and {@code setXxx} methods, custom attributes have these too, with a key (the identifier of the - * custom attribute) as an extra argument (see {@link #isCustomSettingSet(Serializable)}, + * unsetXxx}, and {@code setXxx} methods, custom settings have these too, with a key (the identifier of the + * custom setting) as an extra argument (see {@link #isCustomSettingSet(Serializable)}, * {@link MutableProcessingConfiguration#setCustomSetting(Serializable, Object)}, * {@link MutableProcessingConfiguration#unsetCustomSetting(Serializable)}). * <p> * When the {@link ProcessingConfiguration} is part of a setting inheritance chain ({@link Environment} inherits * settings from the main {@link Template}, which inherits from the {@link Configuration}), this method will search - * the custom attribute in the whole inheritance chain, until it finds it. + * the custom setting in the whole inheritance chain, until it finds it. * <p> * To prevent key clashes (and for better performance), it's often a good idea to use enums as keys, rather than * {@link String}-s. If {@link String}-s are used for keys (names) by components that will be reused on several * places, then to avoid accidental name clashes, the names should use a prefix similar to a package name, like * like "com.example.myframework.". * <p> - * The values of custom attributes should be immutable, or at least not changed after they were added as a - * custom attribute value. To store custom state information (such as application or framework specific caches) + * The values of custom settings should be immutable, or at least not changed after they were added as a + * custom setting value. To store custom state information (such as application or framework specific caches) * you should use the methods provided by {@link CustomStateScope} instead. * <p> - * The FreeMarker core doesn't provide any means for accessing custom attributes from the templates. If a framework + * The FreeMarker core doesn't provide any means for accessing custom settings from the templates. If a framework * or application needs such functionality, it has to add its own custom directives/methods for that. But its - * more typical that custom attributes just influence the behavior of custom directives/methods without the normal + * more typical that custom settings just influence the behavior of custom directives/methods without the normal * templates directly accessing them, or that they are just used by the framework code that invokes templates. * * @param key - * The identifier (usually an enum or a {@link String}) of the custom attribute; not {@code null}; must be + * The identifier (usually an enum or a {@link String}) of the custom setting; not {@code null}; must be * usable as {@link HashMap} key * - * @return The value of the custom attribute; possibly {@code null}, as that's a legal attribute value. The content + * @return The value of the custom setting; possibly {@code null}, as that's a legal attribute value. The content * of the value object shouldn't be changed after it was added as an attribute (ideally, it should be an * immutable object); if you need to change the content, certainly you should use the {@link CustomStateScope} - * API. Note that if the custom attribute was created with <tt><#ftl customSettings={...}></tt>, then + * API. Note that if the custom setting was created with <tt><#ftl customSettings={...}></tt>, then * this value is already unwrapped (i.e. it's a <code>String</code>, or a <code>List</code>, or a <code>Map</code>, * ...etc., not a FreeMarker specific class). * - * @throws CustomSettingNotSetException if the custom attribute was not set (not even to {@code null}), nor in + * @throws CustomSettingNotSetException if the custom setting was not set (not even to {@code null}), nor in * this {@link ProcessingConfiguration}, nor in another where we inherit settings from. Use * {@link #getCustomSetting(Serializable, Object)} to avoid this exception. */ @@ -731,7 +731,7 @@ public interface ProcessingConfiguration { Object getCustomSetting(Serializable key, Object defaultValue); /** - * Tells if this custom attribute is set directly in this object (not in its parent + * Tells if this custom setting is set directly in this object (not in its parent * {@link ProcessingConfiguration}). If not, then depending on the implementing class, reading the custom * attribute might returns the value of the setting from a parent object, or returns {@code null}, or throws a * {@link SettingValueNotSetException}. Note that if an attribute was set to {@code @@ -740,17 +740,17 @@ public interface ProcessingConfiguration { boolean isCustomSettingSet(Serializable key); /** - * Collects all {@linkplain #getCustomSetting(Serializable)} custom attributes} into a {@link Map}; mostly useful for + * Collects all {@linkplain #getCustomSetting(Serializable)} custom settings} into a {@link Map}; mostly useful for * debugging and tooling, and is possibly too slow to call very frequently. * * @param includeInherited - * If {@code false}, only the custom attributes set in this {@link ProcessingConfiguration} will be - * collected, otherwise the custom attributes inherited from the parent {@link ProcessingConfiguration}-s + * If {@code false}, only the custom settings set in this {@link ProcessingConfiguration} will be + * collected, otherwise the custom settings inherited from the parent {@link ProcessingConfiguration}-s * will be too. Note that it's the last that matches the behavior of {@link * #getCustomSetting(Serializable)}. * * @return An unmodifiable and unchanging {@link Map}; not {@code null}. The object identity of keys and values of - * this {@link Map} will not change when custom attributes are set/unset later (hence it's a snapshot). But, if + * this {@link Map} will not change when custom settings are set/unset later (hence it's a snapshot). But, if * a key or value objects are themselves mutable objects, FreeMarker can't prevent their content from changing. * You shouldn't change the content of those objects. */ http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea2a285c/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java b/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java index feac008..8b8db5e 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java @@ -110,11 +110,11 @@ public class Template implements ProcessingConfiguration, CustomStateScope { private String defaultNS; private Map prefixToNamespaceURILookup = new HashMap(); private Map namespaceURIToPrefixLookup = new HashMap(); - /** Custom attributes specified inside the template with the #ftl directive. Maybe {@code null}. */ + /** Custom settings specified inside the template with the #ftl directive. Maybe {@code null}. */ private Map<String, Serializable> headerCustomSettings; /** * In case {@link #headerCustomSettings} is not {@code null} and the {@link TemplateConfiguration} also specifies - * custom attributes, this is the two set of custom attributes merged. Otherwise it's {@code null}. + * custom settings, this is the two set of custom settings merged. Otherwise it's {@code null}. */ private transient Map<Serializable, Object> tcAndHeaderCustomSettings; http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea2a285c/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java ---------------------------------------------------------------------- diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java index 016e24d..9f4fac5 100644 --- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java +++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java @@ -153,7 +153,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; * <li>If the {@value #INIT_PARAM_OVERRIDE_RESPONSE_CONTENT_TYPE} init-param is {@value #INIT_PARAM_VALUE_NEVER} (the * default is {@value #INIT_PARAM_VALUE_ALWAYS}), then the value of {@link HttpServletResponse#getContentType()} is used * if that's non-{@code null}. - * <li>The template's <tt>content_type</tt> custom attribute, usually specified via the <tt>attributes</tt> parameter of + * <li>The template's <tt>content_type</tt> custom setting, usually specified via the <tt>attributes</tt> parameter of * the <tt><#ftl></tt> directive. This is a legacy feature, deprecated by the {@link OutputFormat} mechanism. * <li>The {@linkplain Template#getOutputFormat() output format of the template}, if that has non-{@code null} MIME-type * ({@link OutputFormat#getMimeType()}). When a template has no output format specified, {@link UndefinedOutputFormat} @@ -179,7 +179,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; * type in the response, unless {@link HttpServletResponse#getContentType()} is {@code null}. The third possible value * is {@value #INIT_PARAM_VALUE_WHEN_TEMPLATE_HAS_MIME_TYPE}, which means that we only set the content type if either * the template has an associated {@link OutputFormat} with non-{@code null} {@link OutputFormat#getMimeType()}, or it - * has a custom attribute with name <tt>content_type</tt>, or {@link HttpServletResponse#getContentType()} is + * has a custom setting with name <tt>content_type</tt>, or {@link HttpServletResponse#getContentType()} is * {@code null}. Setting this init-param allows you to specify the content type before forwarding to * {@link FreemarkerServlet}.</li> *
