public class SystemRegistryImpl extends Object implements SystemRegistry
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SystemRegistryImpl.CommandData |
static class |
SystemRegistryImpl.Pipe |
SystemRegistry.RegisteriesCommandRegistry.CommandSession| Constructor and Description |
|---|
SystemRegistryImpl(org.jline.reader.Parser parser,
org.jline.terminal.Terminal terminal,
Supplier<Path> workDir,
ConfigurationPath configPath) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCompleter(org.jline.reader.Completer completer) |
void |
cleanUp()
Delete temporary console variables and reset output streams
|
void |
close()
Orderly close SystemRegistry.
|
Map<String,String> |
commandAliases()
Returns a map of alias-to-command names known by this registry.
|
CmdDesc |
commandDescription(CmdLine line)
Returns a command, method or syntax description for use in the JLine Widgets framework.
|
CmdDesc |
commandDescription(List<String> args)
Returns a command description for use in the JLine Widgets framework.
|
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.
|
org.jline.reader.impl.completer.SystemCompleter |
compileCompleters()
Returns a
SystemCompleter that can provide detailed completion
information for all registered commands. |
org.jline.reader.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
|
Collection<String> |
getPipeNames() |
SystemRegistryImpl |
groupCommandsInHelp(boolean commandGroups) |
boolean |
hasCommand(String command)
Returns whether a command with the specified name is known to this registry.
|
void |
initialize(File script)
Initialize consoleEngine environment by executing console script
|
Object |
invoke(String command,
Object... args)
Execute command with arguments
|
void |
register(String command,
CommandRegistry subcommandRegistry)
Register subcommand registry
|
void |
rename(SystemRegistryImpl.Pipe pipe,
String name) |
void |
setCommandRegistries(CommandRegistry... commandRegistries)
Set command registeries
|
void |
setGroupCommandsInHelp(boolean commandGroups) |
void |
setScriptDescription(Function<CmdLine,CmdDesc> scriptDescription) |
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, waitadd, get, removeaggregateCompleters, compileCompleters, invoke, namepublic SystemRegistryImpl(org.jline.reader.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()
CommandRegistrycommandNames in interface CommandRegistrypublic Map<String,String> commandAliases()
CommandRegistrycommandAliases in interface CommandRegistrypublic Object consoleOption(String name)
SystemRegistryconsoleOption in interface ConsoleOptionGetterconsoleOption 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)
CommandRegistrycommandInfo in interface CommandRegistrycommand - the command namepublic boolean hasCommand(String command)
CommandRegistryhasCommand in interface CommandRegistrycommand - the command name to testpublic void setGroupCommandsInHelp(boolean commandGroups)
public SystemRegistryImpl groupCommandsInHelp(boolean commandGroups)
public void addCompleter(org.jline.reader.Completer completer)
public org.jline.reader.impl.completer.SystemCompleter compileCompleters()
CommandRegistrySystemCompleter that can provide detailed completion
information for all registered commands.compileCompleters in interface CommandRegistrypublic org.jline.reader.Completer completer()
SystemRegistrycompleter in interface SystemRegistrypublic CmdDesc commandDescription(List<String> args)
CommandRegistrycommandDescription in interface CommandRegistryargs - command (args[0]) and its argumentspublic CmdDesc commandDescription(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 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.