velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1858207 - /velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java
Date Fri, 26 Apr 2019 14:04:57 GMT
Author: cbrisson
Date: Fri Apr 26 14:04:57 2019
New Revision: 1858207

URL: http://svn.apache.org/viewvc?rev=1858207&view=rev
Log:
[tools/view] Let VelocityTools subclasses define their own set of default tools

Modified:
    velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java

Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java?rev=1858207&r1=1858206&r2=1858207&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java
(original)
+++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java
Fri Apr 26 14:04:57 2019
@@ -404,7 +404,8 @@ public class VelocityView extends ViewTo
         {
             // add all available default tools
             getLog().trace("Loading default tools configuration...");
-            factoryConfig.addConfiguration(ConfigurationUtils.getDefaultTools());
+            // give a chance for subclasses to define their own default tools
+            addDefaultToolsConfiguration(factoryConfig);
         }
 
         // check for application-wide user config in the context init params
@@ -460,6 +461,11 @@ public class VelocityView extends ViewTo
         configure(factoryConfig);
     }
 
+    protected void addDefaultToolsConfiguration(FactoryConfiguration factoryConfig)
+    {
+        factoryConfig.addConfiguration(ConfigurationUtils.getDefaultTools());
+    }
+
     private boolean setConfig(FactoryConfiguration factory, String path, boolean require)
     {
         if (path == null)



Mime
View raw message