public class CommandRegistry extends Object
Constructor and Description |
---|
CommandRegistry()
Given an object instance this method looks for public methods in that given object with the
annotation
@TerminalCommand and tries to register those as terminal
commands with creating a command executor for that method. |
Modifier and Type | Method and Description |
---|---|
(package private) CommandExecutor |
getCommandExecutor(String key)
Retrieves the executor for the given command name or the alias
|
Collection<CommandExecutor> |
getRegisteredCommandExecutors()
Retrieves all the registered command executors
|
(package private) boolean |
isRegistered(String key)
Checks whether there is a command executor registered for the give command
|
CommandRegistry()
@TerminalCommand
and tries to register those as terminal
commands with creating a command executor
for that method.
Further if a method annotated with the above annotation has parameters annotated with
@CommandOption
those will be considered as options of the terminal
command.
boolean isRegistered(String key)
key
- command name or the alias to check for an executorCommandExecutor getCommandExecutor(String key)
key
- name or the alias of the commandpublic Collection<CommandExecutor> getRegisteredCommandExecutors()
Copyright © 2016–2019 AdroitLogic. All rights reserved.