Package org.jline.console.impl
Class AbstractCommandRegistry
java.lang.Object
org.jline.console.impl.AbstractCommandRegistry
- All Implemented Interfaces:
CommandRegistry
- Direct Known Subclasses:
JlineCommandRegistry
CommandRegistry common methods.
- Author:
- Matti Rinta-Nikkola
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jline.console.CommandRegistry
CommandRegistry.CommandSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns a map of alias-to-command names known by this registry.Returns the command names known by this registry.org.jline.reader.impl.completer.SystemCompleterReturns aSystemCompleterthat can provide detailed completion information for all registered commands.doHelpDesc(String command, List<String> info, CmdDesc cmdDesc) getCommandMethods(String command) booleanhasCommand(String command) Returns whether a command with the specified name is known to this registry.invoke(CommandRegistry.CommandSession session, String command, Object... args) Execute a command.voidregisterCommands(Map<String, CommandMethods> commandExecute) <T extends Enum<T>>
voidregisterCommands(Map<T, String> commandName, Map<T, CommandMethods> commandExecute) registeredCommand(String command) <V extends Enum<V>>
voidvoidsaveException(Exception exception) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jline.console.CommandRegistry
commandDescription, commandInfo, name
-
Constructor Details
-
AbstractCommandRegistry
public AbstractCommandRegistry()
-
-
Method Details
-
doHelpDesc
-
registerCommands
public <T extends Enum<T>> void registerCommands(Map<T, String> commandName, Map<T, CommandMethods> commandExecute) -
registerCommands
-
invoke
public Object invoke(CommandRegistry.CommandSession session, String command, Object... args) throws Exception Description copied from interface:CommandRegistryExecute a command.- Specified by:
invokein interfaceCommandRegistry- Parameters:
session- the data of the current command sessioncommand- the name of the commandargs- arguments of the command- Returns:
- result of the command execution
- Throws:
Exception- in case of error
-
saveException
-
hasCommand
Description copied from interface:CommandRegistryReturns whether a command with the specified name is known to this registry.- Specified by:
hasCommandin interfaceCommandRegistry- Parameters:
command- the command name to test- Returns:
- true if the specified command is registered
-
commandNames
Description copied from interface:CommandRegistryReturns the command names known by this registry.- Specified by:
commandNamesin interfaceCommandRegistry- Returns:
- the set of known command names, excluding aliases
-
commandAliases
Description copied from interface:CommandRegistryReturns a map of alias-to-command names known by this registry.- Specified by:
commandAliasesin interfaceCommandRegistry- Returns:
- a map with alias keys and command name values
-
rename
-
alias
-
compileCompleters
public org.jline.reader.impl.completer.SystemCompleter compileCompleters()Description copied from interface:CommandRegistryReturns aSystemCompleterthat can provide detailed completion information for all registered commands.- Specified by:
compileCompletersin interfaceCommandRegistry- Returns:
- a SystemCompleter that can provide command completion for all registered commands
-
getCommandMethods
-
registeredCommand
-