#727 Instantiate ExecutableCommand objects in CommandHandler

- Change CommandDescription to contain a reference to ExecutableCommand class only
- Instantiate the actual ExecutableCommand objects in CommandHandler
This commit is contained in:
ljacqu
2016-06-04 21:13:38 +02:00
parent c6778b566d
commit 26ac466035
19 changed files with 320 additions and 331 deletions
@@ -1,6 +1,6 @@
package fr.xephi.authme.command.executable.email;
import fr.xephi.authme.command.CommandService;
import fr.xephi.authme.command.CommandMapper;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.command.FoundCommandResult;
import fr.xephi.authme.command.help.HelpProvider;
@@ -16,11 +16,14 @@ import java.util.List;
public class EmailBaseCommand implements ExecutableCommand {
@Inject
private CommandService commandService;
private CommandMapper commandMapper;
@Inject
private HelpProvider helpProvider;
@Override
public void executeCommand(CommandSender sender, List<String> arguments) {
FoundCommandResult result = commandService.mapPartsToCommand(sender, Collections.singletonList("email"));
commandService.outputHelp(sender, result, HelpProvider.SHOW_CHILDREN);
FoundCommandResult result = commandMapper.mapPartsToCommand(sender, Collections.singletonList("email"));
helpProvider.outputHelp(sender, result, HelpProvider.SHOW_CHILDREN);
}
}