public abstract class AbstractCommandRegistry extends Object implements CommandRegistry
CommandRegistry.CommandSession| Constructor and Description |
|---|
AbstractCommandRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
alias(String alias,
String command) |
Map<String,String> |
commandAliases()
Returns a map of alias-to-command names known by this registry.
|
Set<String> |
commandNames()
Returns the command names known by this registry.
|
org.jline.reader.impl.completer.SystemCompleter |
compileCompleters()
Returns a
SystemCompleter that can provide detailed completion
information for all registered commands. |
CmdDesc |
doHelpDesc(String command,
List<String> info,
CmdDesc cmdDesc) |
CommandMethods |
getCommandMethods(String command) |
boolean |
hasCommand(String command)
Returns whether a command with the specified name is known to this registry.
|
Object |
invoke(CommandRegistry.CommandSession session,
String command,
Object... args)
Execute a command.
|
void |
registerCommands(Map<String,CommandMethods> commandExecute) |
<T extends Enum<T>> |
registerCommands(Map<T,String> commandName,
Map<T,CommandMethods> commandExecute) |
Object |
registeredCommand(String command) |
<V extends Enum<V>> |
rename(V command,
String newName) |
void |
saveException(Exception exception) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggregateCompleters, commandDescription, commandInfo, compileCompleters, namepublic <T extends Enum<T>> void registerCommands(Map<T,String> commandName, Map<T,CommandMethods> commandExecute)
public void registerCommands(Map<String,CommandMethods> commandExecute)
public Object invoke(CommandRegistry.CommandSession session, String command, Object... args) throws Exception
CommandRegistryinvoke in interface CommandRegistrysession - the data of the current command sessioncommand - the name of the commandargs - arguments of the commandException - in case of errorpublic void saveException(Exception exception)
public boolean hasCommand(String command)
CommandRegistryhasCommand in interface CommandRegistrycommand - the command name to testpublic Set<String> commandNames()
CommandRegistrycommandNames in interface CommandRegistrypublic Map<String,String> commandAliases()
CommandRegistrycommandAliases in interface CommandRegistrypublic org.jline.reader.impl.completer.SystemCompleter compileCompleters()
CommandRegistrySystemCompleter that can provide detailed completion
information for all registered commands.compileCompleters in interface CommandRegistrypublic CommandMethods getCommandMethods(String command)
Copyright © 2020. All rights reserved.