Class AbstractCommandManager<P,S>
java.lang.Object
io.github.mqzn.commands.base.manager.AbstractCommandManager<P,S>
- Type Parameters:
P
- The bootstrap for the lib to work onS
- The command sender type
- All Implemented Interfaces:
CommandManager<P,
S>
The class responsible for handling,
registering, and coordinating the execution of the
available commands
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull io.github.mqzn.commands.base.manager.ArgumentNumberSuggestionProcessor
protected final P
protected final @NotNull CaptionRegistry<S>
protected final Logger
protected final @NotNull SenderProviderRegistry<S>
protected final @NotNull SenderWrapper<S>
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractCommandManager
(P bootstrap, @NotNull SenderWrapper<S> wrapper) AbstractCommandManager
(P bootstrap, @NotNull SenderWrapper<S> wrapper, CommandExecutionCoordinator.Type coordinator) -
Method Summary
Modifier and TypeMethodDescription@NotNull CaptionRegistry<S>
@NotNull CommandExceptionHandler<S>
final <C> void
executeCommand
(@NotNull Command<S> command, S sender, @NotNull String[] args) @NotNull List<CommandSyntax<S>>
findAmbiguity
(@NotNull List<CommandSyntax<S>> syntaxes) @Nullable CommandSyntax<S>
findSyntax
(@NotNull Command<S> command, @NotNull DelegateCommandContext<S> commandContext) @NotNull FlagRegistry
getCommand
(String name) @NotNull Collection<Command<S>>
@NotNull SenderWrapper<S>
void
handleHelpProvider
(S sender, @NotNull Context<S> context, @NotNull String label, int page, @NotNull List<CommandSyntax<S>> commandSubCommands) @Nullable CommandHelpProvider
void
registerCommand
(C command) @NotNull SenderProviderRegistry<S>
void
setHelpProvider
(@Nullable CommandHelpProvider helpProvider) <N extends Number>
voidsetNumericArgumentSuggestions
(@NotNull ArgumentNumber<N> argNum) @NotNull ArgumentTypeRegistry
void
unregisterCommand
(String name) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.mqzn.commands.base.manager.CommandManager
commandStarter
-
Field Details
-
logger
-
bootstrap
-
argumentNumberSuggestionProcessor
@NotNull protected final @NotNull io.github.mqzn.commands.base.manager.ArgumentNumberSuggestionProcessor argumentNumberSuggestionProcessor -
wrapper
-
captionRegistry
-
senderProviderRegistry
-
-
Constructor Details
-
AbstractCommandManager
public AbstractCommandManager(@NotNull P bootstrap, @NotNull @NotNull SenderWrapper<S> wrapper, @NotNull CommandExecutionCoordinator.Type coordinator) -
AbstractCommandManager
-
-
Method Details
-
getBootstrap
- Specified by:
getBootstrap
in interfaceCommandManager<P,
S>
-
typeRegistry
- Specified by:
typeRegistry
in interfaceCommandManager<P,
S>
-
exceptionHandler
- Specified by:
exceptionHandler
in interfaceCommandManager<P,
S>
-
helpProvider
- Specified by:
helpProvider
in interfaceCommandManager<P,
S>
-
setHelpProvider
- Specified by:
setHelpProvider
in interfaceCommandManager<P,
S>
-
handleHelpProvider
public void handleHelpProvider(@NotNull S sender, @NotNull @NotNull Context<S> context, @NotNull @NotNull String label, int page, @NotNull @NotNull List<CommandSyntax<S>> commandSubCommands) - Specified by:
handleHelpProvider
in interfaceCommandManager<P,
S>
-
executeCommand
public final <C> void executeCommand(@NotNull @NotNull Command<S> command, @NotNull S sender, @NotNull @NotNull String[] args) - Specified by:
executeCommand
in interfaceCommandManager<P,
S>
-
findSyntax
@Nullable public @Nullable CommandSyntax<S> findSyntax(@NotNull @NotNull Command<S> command, @NotNull @NotNull DelegateCommandContext<S> commandContext) - Specified by:
findSyntax
in interfaceCommandManager<P,
S>
-
getSenderWrapper
- Specified by:
getSenderWrapper
in interfaceCommandManager<P,
S>
-
registerCommand
- Specified by:
registerCommand
in interfaceCommandManager<P,
S>
-
unregisterCommand
- Specified by:
unregisterCommand
in interfaceCommandManager<P,
S>
-
getCommand
- Specified by:
getCommand
in interfaceCommandManager<P,
S>
-
getCommands
- Specified by:
getCommands
in interfaceCommandManager<P,
S>
-
flagRegistry
- Specified by:
flagRegistry
in interfaceCommandManager<P,
S>
-
captionRegistry
- Specified by:
captionRegistry
in interfaceCommandManager<P,
S>
-
senderProviderRegistry
- Specified by:
senderProviderRegistry
in interfaceCommandManager<P,
S>
-
suggest
- Specified by:
suggest
in interfaceCommandManager<P,
S>
-
findAmbiguity
@NotNull public @NotNull List<CommandSyntax<S>> findAmbiguity(@NotNull @NotNull List<CommandSyntax<S>> syntaxes) - Specified by:
findAmbiguity
in interfaceCommandManager<P,
S>
-
setNumericArgumentSuggestions
public <N extends Number> void setNumericArgumentSuggestions(@NotNull @NotNull ArgumentNumber<N> argNum) - Specified by:
setNumericArgumentSuggestions
in interfaceCommandManager<P,
S>
-
log
- Specified by:
log
in interfaceCommandManager<P,
S>
-