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