Class AutoCommandRegistrar
java.lang.Object
com.zetaplugins.zetacore.services.commands.AutoCommandRegistrar
- All Implemented Interfaces:
CommandRegistrar
Manages the registration of commands and tab completers for a plugin.
Use the
AutoRegisterCommand annotation to mark command classes for automatic registration.
Use the AutoRegisterTabCompleter annotation to mark tab completer classes for automatic registration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRegisters all commands annotated withAutoRegisterCommandand tab completers annotated withAutoRegisterTabCompleter.voidregisterCommand(String name, CommandExecutor executor, TabCompleter tabCompleter) Manually registers a commandMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.zetaplugins.zetacore.services.commands.CommandRegistrar
registerCommand
-
Constructor Details
-
AutoCommandRegistrar
- Parameters:
plugin- The JavaPlugin instance.packagePrefix- The package prefix to scan for annotated classes.
-
-
Method Details
-
registerAllCommands
Registers all commands annotated withAutoRegisterCommandand tab completers annotated withAutoRegisterTabCompleter.- Specified by:
registerAllCommandsin interfaceCommandRegistrar- Returns:
- A list of names of the registered commands.
-
registerCommand
Manually registers a command- Specified by:
registerCommandin interfaceCommandRegistrar- Parameters:
name- The name of the commandexecutor- The executor of the commandtabCompleter- The tab completer of the command
-