Package studio.mevera.imperat
Interface CommandRegistrar<S extends Source>
- All Known Subinterfaces:
Imperat<S>
- All Known Implementing Classes:
BaseImperat
-
Method Summary
Modifier and TypeMethodDescriptiongetCommand(String name) getCommand(CommandParameter<S> parameter) Collection<? extends Command<S>>Gets all registered commandsgetSubCommand(String owningCommand, String name) voidregisterCommand(Class<?> command) Registers a command class built by the annotations using a parservoidregisterCommand(Object commandInstance) Registers a command instance built by the annotations using a parservoidregisterCommand(Command<S> command) Registers a command into the dispatcherdefault voidregisterCommands(Class<?>... commands) Registers some commands into the dispatcher annotations using a parserdefault voidregisterCommands(Object... commandInstances) Registers some command instances built by the annotations using a parserdefault voidregisterCommands(Command<S>... commands) Registers some commands into the dispatchervoidUnregisters all commands from the internal registryvoidunregisterCommand(String name) Unregisters a command from the internal registry
-
Method Details
-
registerCommand
Registers a command into the dispatcher- Parameters:
command- the command to register
-
registerCommands
Registers some commands into the dispatcher- Parameters:
commands- the commands to register
-
registerCommand
Registers a command class built by the annotations using a parser- Parameters:
command- the annotated command instance to parse
-
registerCommands
Registers some commands into the dispatcher annotations using a parser- Parameters:
commands- the commands to register
-
registerCommand
Registers a command instance built by the annotations using a parser- Parameters:
commandInstance- the annotated command instance to parse
-
registerCommands
Registers some command instances built by the annotations using a parser- Parameters:
commandInstances- the annotated command instances to parse
-
unregisterCommand
Unregisters a command from the internal registry- Parameters:
name- the name of the command to unregister
-
unregisterAllCommands
void unregisterAllCommands()Unregisters all commands from the internal registry -
getCommand
- Parameters:
name- the name/alias of the command- Returns:
- fetches
Commandwith specific name
-
getCommand
- Parameters:
parameter- the parameter- Returns:
- the command from the parameter's name
-
getSubCommand
- Parameters:
owningCommand- the command owning this sub-commandname- the name of the subcommand you're looking for- Returns:
- the subcommand of a command
-
getRegisteredCommands
Collection<? extends Command<S>> getRegisteredCommands()Gets all registered commands- Returns:
- the registered commands
-