The CommandManager is the central entry point for the Annotation Command Framework (ACF). It is an abstract class that you must extend to implement your specific command handling logic. It manages command registration, dependency injection, locales, and exception handling.
To use it, you must implement the abstract methods such as registerCommand, getCommandContexts, getCommandCompletions, and getCommandIssuer.
public class MyCommandManager extends CommandManager<MyType, MyIssuer, MyFormat, MyMessageFormatter, MyExecutionContext, MyConditionContext> {
@Override
public void registerCommand(BaseCommand command) {
// Implementation for registering commands
}
@Override
public CommandContexts<?> getCommandContexts() {
return null; // Implementation
}
@Override
public CommandCompletions<?> getCommandCompletions() {
return null; // Implementation
}
@Override
public MyIssuer getCommandIssuer(Object issuer) {
return (MyIssuer) issuer;
}
@Override
public boolean isCommandIssuer(Class<?> type) {
return MyIssuer.class.isAssignableFrom(type);
}
@Override
public RootCommand createRootCommand(String cmd) {
return null; // Implementation
}
@Override
public Locales getLocales() {
return null; // Implementation
}
@Override
public CommandExecutionContext<?> createCommandContext(RegisteredCommand command, CommandParameter parameter, CommandIssuer sender, List<String> args, int i, Map<String, Object> passedArgs) {
return null; // Implementation
}
@Override
public CommandCompletionContext createCompletionContext(RegisteredCommand command, CommandIssuer sender, String input, String config, String[] args) {
return null; // Implementation
}
@Override
public void log(LogLevel level, String message, Throwable throwable) {
// Implementation
}
@Override
public Collection<RootCommand> getRegisteredRootCommands() {
return null; // Implementation
}
}