Author: nbubna
Date: Wed Nov 29 22:19:04 2006
New Revision: 480849

URL: http://svn.apache.org/viewvc?view=rev&rev=480849
Log:
add getToolbox() for read-only access to the context's tools

Modified:
    
jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/context/ChainedContext.java

Modified: 
jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/context/ChainedContext.java
URL: 
http://svn.apache.org/viewvc/jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/context/ChainedContext.java?view=diff&rev=480849&r1=480848&r2=480849
==============================================================================
--- 
jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/context/ChainedContext.java
 (original)
+++ 
jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/context/ChainedContext.java
 Wed Nov 29 22:19:04 2006
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import java.util.Collections;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -130,6 +131,22 @@
          * had to create a new session to hold session tools
          * let's make sure this context's session ref is current */
         this.session = request.getSession(false);
+    }
+
+    /**
+     * <p>Returns a read-only view of the toolbox [EMAIL PROTECTED] Map}
+     * for this context.</p>
+     * @since VelocityTools 1.3
+     * @return an unmodifiable version of the toolbox for this request
+     *         or [EMAIL PROTECTED] null} if there is none
+     */
+    public Map getToolbox()
+    {
+        if (this.toolbox != null)
+        {
+            return Collections.unmodifiableMap(this.toolbox);
+        }
+        return null;
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to