Package org.jline.console
Interface SystemRegistry
- All Superinterfaces:
CommandRegistry,ConsoleOptionGetter
- All Known Implementing Classes:
SimpleSystemRegistryImpl,SystemRegistryImpl
Aggregate command registries and dispatch command executions.
- Author:
- Matti Rinta-Nikkola
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classManage systemRegistry storeNested classes/interfaces inherited from interface org.jline.console.CommandRegistry
CommandRegistry.CommandSession -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(SystemRegistry systemRegistry) Add systemRegistry to the thread mapvoidcleanUp()Delete temporary console variables and reset output streamsvoidclose()Orderly close SystemRegistry.commandDescription(CmdLine line) Returns a command, method or syntax description for use in the JLine Widgets framework.Returns command completer that includes also console variable and script completion.consoleOption(String name) Return console option value<T> TconsoleOption(String name, T defVal) Return console option valueExecute a command, script or evaluate scriptEngine statementstatic SystemRegistryget()voidinitialize(File script) Initialize consoleEngine environment by executing console scriptExecute command with argumentsbooleanisCommandAlias(String alias) Returns whether alias is known command alias.booleanisCommandOrScript(String command) Returns whether command is known to this registry.booleanisCommandOrScript(ParsedLine line) Returns whether a line contains command/script that is known to this registry.voidregister(String command, CommandRegistry subcommandRegistry) Register subcommand registrystatic voidremove()Remove systemRegistry of the current thread from the thread mapvoidsetCommandRegistries(CommandRegistry... commandRegistries) Set command registriesvoidsetConsoleOption(String name, Object value) Set console option valueterminal()voidPrint exception on terminalvoidPrint exception on terminalMethods inherited from interface org.jline.console.CommandRegistry
commandAliases, commandDescription, commandInfo, commandNames, compileCompleters, hasCommand, invoke, name
-
Method Details
-
setCommandRegistries
Set command registries- Parameters:
commandRegistries- command registries used by the application
-
register
Register subcommand registry- Parameters:
command- main commandsubcommandRegistry- subcommand registry
-
initialize
Initialize consoleEngine environment by executing console script- Parameters:
script- initialization script
-
getPipeNames
Collection<String> getPipeNames()- Returns:
- pipe names defined in systemRegistry
-
completer
Completer completer()Returns command completer that includes also console variable and script completion.- Returns:
- command completer
-
commandDescription
-
execute
-
cleanUp
void cleanUp()Delete temporary console variables and reset output streams -
trace
Print exception on terminal- Parameters:
exception- exception to print on terminal
-
trace
Print exception on terminal- Parameters:
stack- print stack trace if stack true otherwise messageexception- exception to be printed
-
consoleOption
Return console option value- Specified by:
consoleOptionin interfaceConsoleOptionGetter- Parameters:
name- the option name- Returns:
- option value
-
consoleOption
Return console option value- Specified by:
consoleOptionin interfaceConsoleOptionGetter- Type Parameters:
T- option type- Parameters:
name- the option namedefVal- value to return if console option does not exists- Returns:
- option value
-
setConsoleOption
-
terminal
Terminal terminal()- Returns:
- terminal
-
invoke
-
isCommandOrScript
Returns whether a line contains command/script that is known to this registry.- Parameters:
line- the parsed command line to test- Returns:
- true if the specified line has a command registered
-
isCommandOrScript
Returns whether command is known to this registry.- Parameters:
command- the command to test- Returns:
- true if the specified command is known
-
isCommandAlias
Returns whether alias is known command alias.- Parameters:
alias- the alias to test- Returns:
- true if the alias is known command alias
-
close
void close()Orderly close SystemRegistry. -
get
- Returns:
- systemRegistry of the current thread
-
add
Add systemRegistry to the thread map- Parameters:
systemRegistry- the systemRegistry
-
remove
static void remove()Remove systemRegistry of the current thread from the thread map
-