package refactoring.struts; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.struts.config.ActionConfig; import refactoring.struts.beans.MappingAnnotationBean; public class LogMissingDispatchAction implements Serializable { private static final long serialVersionUID = -5796226122097186228L; private final Map> mappingsLogged; private final Map> singleForwardMapping; private final List namelessMappings; private final List alreadyContainsMapping; public LogMissingDispatchAction() { mappingsLogged = new HashMap>(); singleForwardMapping = new HashMap>(); namelessMappings = new ArrayList(); alreadyContainsMapping = new ArrayList(); } public void logMapping(String dispatchActionFileName, ActionConfig actionConfig) { List loggedConfigsForThisFile = this.mappingsLogged.get(dispatchActionFileName); if (loggedConfigsForThisFile == null) { loggedConfigsForThisFile = new ArrayList(); loggedConfigsForThisFile.add(actionConfig); this.mappingsLogged.put(dispatchActionFileName, loggedConfigsForThisFile); } else { loggedConfigsForThisFile.add(actionConfig); } } public void logSingleForward(String dispatchActionFileName, ActionConfig actionConfig) { List loggedSingleForwardsForThisFile = this.singleForwardMapping.get(dispatchActionFileName); if (loggedSingleForwardsForThisFile == null) { loggedSingleForwardsForThisFile = new ArrayList(); loggedSingleForwardsForThisFile.add(actionConfig); this.singleForwardMapping.put(dispatchActionFileName, loggedSingleForwardsForThisFile); } else { loggedSingleForwardsForThisFile.add(actionConfig); } } public void addNamelessMapping(ActionConfig mapping) { this.namelessMappings.add(mapping); } public void logAlreadyContainsMapping(MappingAnnotationBean bean) { alreadyContainsMapping.add(bean); } public Map> getLoggedMappings() { return this.mappingsLogged; } public Map> getSingleForwardMappings() { return this.singleForwardMapping; } public List getNamelessMappings() { return this.namelessMappings; } public List getAlreadyContainsMapping() { return this.alreadyContainsMapping; } }