www.pudn.com > dangdang.zip > ModuleConfig.java, change:2006-06-22,size:1135b


package org.smartstruts.config; 
 
import java.util.HashMap; 
import java.util.Map; 
 
public class ModuleConfig { 
	private Map<String,FormBeanConfig> beans = new HashMap<String,FormBeanConfig>(); 
	private Map<String,ForwardConfig> globalForwards = new HashMap<String,ForwardConfig>(); 
	private Map<String,ActionConfig> actions = new HashMap<String,ActionConfig>(); 
	 
	public void addFormBeanConfig(FormBeanConfig bean){ 
		beans.put(bean.getName(), bean); 
	} 
	 
	public void addForwardConfig(ForwardConfig config){ 
		globalForwards.put(config.getName(), config); 
	} 
	 
	public void addActionConfig(ActionConfig action){ 
		actions.put(action.getPath(), action); 
	} 
	 
	public FormBeanConfig findFormBeanConfig(String name){ 
		if(beans.containsKey(name)){ 
			return beans.get(name); 
		} 
		return null; 
	} 
	 
	public ForwardConfig findForwardConfig(String name){ 
		if(globalForwards.containsKey(name)){ 
			return globalForwards.get(name); 
		} 
		return null; 
	} 
	 
	public ActionConfig findActionConfig(String path){ 
		if(actions.containsKey(path)){ 
			return actions.get(path); 
		} 
		return null; 
	} 
	 
}