1 package jp.sourceforge.stigmata.command;
3 import java.util.HashMap;
6 import jp.sourceforge.stigmata.StigmataCommand;
10 * @author Haruaki Tamada
12 public class StigmataCommandFactory{
13 private static final StigmataCommandFactory factory = new StigmataCommandFactory();
14 private Map<String, StigmataCommand> commands = new HashMap<String, StigmataCommand>();
16 private StigmataCommandFactory(){
17 commands.put("compare", new CompareCommand());
18 commands.put("export-config", new ExportConfigCommand());
19 commands.put("extract", new ExtractCommand());
20 commands.put("gui", new GuiCommand());
21 commands.put("install", new InstallCommand());
22 commands.put("license", new LicenseCommand());
23 commands.put("list-birthmarks", new ListBirthmarksCommand());
24 /* this command is not supported in Windows OS.
25 * Deletion/Renaming is failed because plugin file is locked by system.
26 * commands.put("uninstall", new UninstallCommand());
28 commands.put("version", new VersionCommand());
31 public void registerCommand(String commandString, StigmataCommand command){
32 commands.put(commandString, command);
35 public static StigmataCommandFactory getInstance(){
39 public StigmataCommand getCommand(String command){
40 return commands.get(command);