ConsoleEngine
, SystemRegistry
Builtins
, ConsoleEngineImpl
, SystemRegistryImpl
public interface CommandRegistry
Modifier and Type | Interface | Description |
---|---|---|
static class |
CommandRegistry.CommandSession |
Modifier and Type | Method | Description |
---|---|---|
static Completers.SystemCompleter |
aggregateCompleters(CommandRegistry... commandRegistries) |
Aggregate SystemCompleters of commandRegisteries
|
Map<String,String> |
commandAliases() |
Returns a map of alias-to-command names known by this registry.
|
default Widgets.CmdDesc |
commandDescription(String command) |
Returns a command description for use in the JLine Widgets framework.
|
default List<String> |
commandInfo(String command) |
Returns a short info about command known by this registry.
|
Set<String> |
commandNames() |
Returns the command names known by this registry.
|
Completers.SystemCompleter |
compileCompleters() |
Returns a
SystemCompleter that can provide detailed completion
information for all registered commands. |
static Completers.SystemCompleter |
compileCompleters(CommandRegistry... commandRegistries) |
Aggregate and compile SystemCompleters of commandRegisteries
|
default Object |
execute(CommandRegistry.CommandSession session,
String command,
String[] args) |
Execute a command that have only string parameters and options.
|
boolean |
hasCommand(String command) |
Returns whether a command with the specified name is known to this registry.
|
default Object |
invoke(CommandRegistry.CommandSession session,
String command,
Object... args) |
Execute a command.
|
default String |
name() |
Returns the name of this registry.
|
static Completers.SystemCompleter aggregateCompleters(CommandRegistry... commandRegistries)
commandRegistries
- command registeries which completers is to be aggregatedstatic Completers.SystemCompleter compileCompleters(CommandRegistry... commandRegistries)
commandRegistries
- command registeries which completers is to be aggregated and compiledefault String name()
Set<String> commandNames()
Map<String,String> commandAliases()
default List<String> commandInfo(String command)
boolean hasCommand(String command)
command
- the command name to testCompleters.SystemCompleter compileCompleters()
SystemCompleter
that can provide detailed completion
information for all registered commands.default Widgets.CmdDesc commandDescription(String command)
command
- name of the command whose description to returndefault Object execute(CommandRegistry.CommandSession session, String command, String[] args) throws Exception
session
- the data of the current command sessioncommand
- the name of the commandargs
- arguments of the commandException
- in case of errordefault Object invoke(CommandRegistry.CommandSession session, String command, Object... args) throws Exception
session
- the data of the current command sessioncommand
- the name of the commandargs
- arguments of the commandException
- in case of errorCopyright © 2020. All rights reserved.