SystemRegistry, CommandRegistrypublic class SystemRegistryImpl extends Object implements SystemRegistry
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
SystemRegistryImpl.CommandData |
|
static class |
SystemRegistryImpl.Pipe |
CommandRegistry.CommandSessionSystemRegistry.Registeries| Constructor | Description |
|---|---|
SystemRegistryImpl(Parser parser,
org.jline.terminal.Terminal terminal,
Supplier<Path> workDir,
ConfigurationPath configPath) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addCompleter(Completer completer) |
|
void |
cleanUp() |
Delete temporary console variables and reset output streams
|
void |
close() |
Orderly close SystemRegistry.
|
Map<String,String> |
commandAliases() |
|
CmdDesc |
commandDescription(String command) |
|
CmdDesc |
commandDescription(List<String> args) |
|
CmdDesc |
commandDescription(Widgets.CmdLine line) |
Returns a command, method or syntax description for use in the JLine Widgets framework.
|
List<String> |
commandInfo(String command) |
|
Set<String> |
commandNames() |
|
SystemCompleter |
compileCompleters() |
|
Completer |
completer() |
Returns command completer that includes also console variable and script completion.
|
Object |
consoleOption(String name) |
Return console option value
|
Object |
execute(String line) |
Execute a command, script or evaluate scriptEngine statement
|
Object |
execute(String command,
String[] args) |
Execute command with arguments
|
Collection<String> |
getPipeNames() |
|
boolean |
hasCommand(String command) |
|
void |
initialize(File script) |
Initialize consoleEngine environment by executing console script
|
Object |
invoke(String command,
Object... args) |
Execute command with arguments
|
Object |
localExecute(String command,
Object[] args) |
|
void |
register(String command,
CommandRegistry subcommandRegistry) |
Register subcommand registry
|
void |
rename(SystemRegistryImpl.Pipe pipe,
String name) |
|
void |
setCommandRegistries(CommandRegistry... commandRegistries) |
Set command registeries
|
org.jline.terminal.Terminal |
terminal() |
|
void |
trace(boolean stack,
Exception exception) |
Print exception on terminal
|
void |
trace(Exception exception) |
Print exception on terminal
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecute, invoke, namepublic SystemRegistryImpl(Parser parser, org.jline.terminal.Terminal terminal, Supplier<Path> workDir, ConfigurationPath configPath)
public void rename(SystemRegistryImpl.Pipe pipe, String name)
public Collection<String> getPipeNames()
getPipeNames in interface SystemRegistrypublic void setCommandRegistries(CommandRegistry... commandRegistries)
SystemRegistrysetCommandRegistries in interface SystemRegistrycommandRegistries - command registeries used by the applicationpublic void initialize(File script)
SystemRegistryinitialize in interface SystemRegistryscript - initialization scriptpublic Set<String> commandNames()
commandNames in interface CommandRegistrypublic Map<String,String> commandAliases()
commandAliases in interface CommandRegistrypublic Object consoleOption(String name)
SystemRegistryconsoleOption in interface SystemRegistryname - the option namepublic void register(String command, CommandRegistry subcommandRegistry)
register in interface SystemRegistrycommand - main commandsubcommandRegistry - subcommand registrypublic List<String> commandInfo(String command)
commandInfo in interface CommandRegistrypublic boolean hasCommand(String command)
hasCommand in interface CommandRegistrypublic void addCompleter(Completer completer)
public SystemCompleter compileCompleters()
compileCompleters in interface CommandRegistrypublic Completer completer()
SystemRegistrycompleter in interface SystemRegistrypublic CmdDesc commandDescription(String command)
commandDescription in interface CommandRegistrypublic CmdDesc commandDescription(List<String> args)
commandDescription in interface CommandRegistrypublic CmdDesc commandDescription(Widgets.CmdLine line)
SystemRegistrycommandDescription in interface SystemRegistryline - command line whose description to returnpublic Object invoke(String command, Object... args) throws Exception
SystemRegistryinvoke in interface SystemRegistrycommand - command to be executedargs - arguments of the commandException - in case of errorpublic Object execute(String command, String[] args) throws Exception
SystemRegistryexecute in interface SystemRegistrycommand - command to be executedargs - arguments of the commandException - in case of errorpublic Object localExecute(String command, Object[] args) throws Exception
Exceptionpublic org.jline.terminal.Terminal terminal()
terminal in interface SystemRegistrypublic Object execute(String line) throws Exception
SystemRegistryexecute in interface SystemRegistryline - command line to be executedException - in case of errorpublic void cleanUp()
SystemRegistrycleanUp in interface SystemRegistrypublic void trace(Exception exception)
SystemRegistrytrace in interface SystemRegistryexception - exception to print on terminalpublic void trace(boolean stack,
Exception exception)
SystemRegistrytrace in interface SystemRegistrystack - print stack trace if stack true otherwise messageexception - exception to be printedpublic void close()
SystemRegistryclose in interface SystemRegistryCopyright © 2020. All rights reserved.