KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > cocoon > view > JellyUtils


1 package org.sapia.soto.state.cocoon.view;
2
3 import java.util.Iterator JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import org.apache.commons.jelly.JellyContext;
7
8 /**
9  * @author Yanick Duchesne
10  *
11  * <dl>
12  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2004 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
13  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
14  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
15  * </dl>
16  */

17 public class JellyUtils {
18     
19     /**
20      * Copies the objects in the given parameter map to the given Jelly context.
21      * This method spare existing variables the context.
22      *
23      * @param ctx a <code>JellyContext</code>.
24      * @param params a <code>Map</code> of parameters to bind into the context.
25      */

26     public static void copyParamsTo(JellyContext ctx, Map JavaDoc params){
27         Map.Entry JavaDoc entry;
28         Iterator JavaDoc itr = params.entrySet().iterator();
29         while(itr.hasNext()){
30             entry = (Map.Entry JavaDoc)itr.next();
31             ctx.setVariable(entry.getKey().toString(), entry.getValue());
32         }
33     }
34
35 }
36
Popular Tags