velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r627194 - in /velocity/tools/trunk/src/main/java/org/apache/velocity/tools: ToolContext.java view/ViewToolContext.java
Date Wed, 13 Feb 2008 00:04:55 GMT
Author: nbubna
Date: Tue Feb 12 16:04:54 2008
New Revision: 627194

URL: http://svn.apache.org/viewvc?rev=627194&view=rev
Log:
let getToolbox() be used in ToolContext

Modified:
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java?rev=627194&r1=627193&r2=627194&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java (original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java Tue Feb
12 16:04:54 2008
@@ -107,6 +107,22 @@
         toolboxes.add(toolbox);
     }
 
+    /**
+     * Returns a {@link Map} of all tools available to this
+     * context. NOTE: this is not a cheap operation as it will
+     * request and initialize an instance of every available tool.
+     */
+    public Map<String,Object> getToolbox()
+    {
+        Map<String,Object> aggregate = new HashMap<String,Object>();
+        Map<String,Object> toolProps = getToolProperties();
+        for (Toolbox toolbox : getToolboxes())
+        {
+            aggregate.putAll(toolbox.getAll(toolProps));
+        }
+        return aggregate;
+    }
+
     protected List<Toolbox> getToolboxes()
     {
         return this.toolboxes;

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java?rev=627194&r1=627193&r2=627194&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java
(original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java
Tue Feb 12 16:04:54 2008
@@ -100,22 +100,6 @@
         putToolProperty(PATH_KEY, ServletUtils.getPath(getRequest()));
     }
 
-    /**
-     * Returns a {@link Map} of all tools available to this
-     * context. NOTE: this is not a cheap operation as it will
-     * request and initialize an instance of every available tool.
-     */
-    public Map<String,Object> getToolbox()
-    {
-        Map<String,Object> aggregate = new HashMap<String,Object>();
-        Map<String,Object> toolProps = getToolProperties();
-        for (Toolbox toolbox : getToolboxes())
-        {
-            aggregate.putAll(toolbox.getAll(toolProps));
-        }
-        return aggregate;
-    }
-
     protected List<Toolbox> getToolboxes()
     {
         // this means once we find any toolbox,



Mime
View raw message