1 6 7 package fr.improve.struts.taglib.layout.menu; 8 9 import java.io.Serializable ; 10 import java.util.Set ; 11 12 import javax.servlet.http.HttpServlet ; 13 14 import org.apache.commons.collections.FastHashMap; 15 16 22 public class MenuRepository implements Serializable { 23 24 public static final String MENU_REPOSITORY_KEY = "fr.improve.struts.taglib.layout.menu.MENU_REPOSITORY"; 25 26 protected String config = null; 27 28 protected String name = null; 29 30 protected HttpServlet servlet = null; 31 32 33 protected FastHashMap menus = new FastHashMap(); 34 35 protected FastHashMap displayers = new FastHashMap(); 36 37 38 public Set getMenuNames() { 39 return menus.keySet(); 40 } 41 42 public MenuComponent getMenu(String menuName) { 43 return (MenuComponent)menus.get(menuName); 44 } 45 46 public void addMenu(MenuComponent menu) { 47 menus.put(menu.getName(), menu); 48 } 49 50 public void setLoadParam(String loadParam) { 51 config = loadParam; 52 } 53 public String getLoadParam() { 54 return config; 55 } 56 57 public void setName(String name) { 58 this.name = name; 59 } 60 61 public String getName() { 62 return name; 63 } 64 65 public HttpServlet getServlet() { 66 return servlet; 67 } 68 69 public void setServlet(HttpServlet servlet) { 70 this.servlet = servlet; 71 } 72 } | Popular Tags |