Package org.jline.console.impl
Class SimpleSystemRegistryImpl
java.lang.Object
org.jline.console.impl.SystemRegistryImpl
org.jline.console.impl.SimpleSystemRegistryImpl
- All Implemented Interfaces:
ConsoleOptionGetter,CommandRegistry,SystemRegistry
Simple SystemRegistry which stores variables in the LineReader.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jline.console.impl.SystemRegistryImpl
SystemRegistryImpl.CommandData, SystemRegistryImpl.Pipe, SystemRegistryImpl.UnknownCommandExceptionNested classes/interfaces inherited from interface org.jline.console.CommandRegistry
CommandRegistry.CommandSessionNested classes/interfaces inherited from interface org.jline.console.SystemRegistry
SystemRegistry.Registeries -
Field Summary
Fields inherited from class org.jline.console.impl.SystemRegistryImpl
configPath, parser, workDir -
Constructor Summary
ConstructorsConstructorDescriptionSimpleSystemRegistryImpl(org.jline.reader.Parser parser, org.jline.terminal.Terminal terminal, Supplier<Path> workDir, ConfigurationPath configPath) -
Method Summary
Modifier and TypeMethodDescription<T> TconsoleOption(String name, T defVal) Returns the value of a console option with a default value if the option doesn't exist.voidsetConsoleOption(String name, Object value) Sets the value of a console option.voidsetLineReader(org.jline.reader.LineReader lineReader) Methods inherited from class org.jline.console.impl.SystemRegistryImpl
addCompleter, cleanUp, close, commandAliases, commandDescription, commandDescription, commandInfo, commandNames, compileCompleters, completer, consoleEngine, consoleOption, execute, getPipeNames, groupCommandsInHelp, hasCommand, initialize, invoke, isCommandAlias, isCommandOrScript, isCommandOrScript, register, rename, setCommandRegistries, setGroupCommandsInHelp, setScriptDescription, terminal, trace, traceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jline.console.CommandRegistry
invoke, name
-
Constructor Details
-
SimpleSystemRegistryImpl
public SimpleSystemRegistryImpl(org.jline.reader.Parser parser, org.jline.terminal.Terminal terminal, Supplier<Path> workDir, ConfigurationPath configPath)
-
-
Method Details
-
setLineReader
public void setLineReader(org.jline.reader.LineReader lineReader) -
consoleOption
Description copied from interface:SystemRegistryReturns the value of a console option with a default value if the option doesn't exist.This method retrieves the value of the console option with the specified name, returning a default value if the option doesn't exist. Console options are used to configure the behavior of the console and its components.
- Specified by:
consoleOptionin interfaceConsoleOptionGetter- Specified by:
consoleOptionin interfaceSystemRegistry- Overrides:
consoleOptionin classSystemRegistryImpl- Type Parameters:
T- the type of the option value- Parameters:
name- the name of the option to retrievedefVal- the default value to return if the option doesn't exist- Returns:
- the value of the option, or the default value if the option doesn't exist
-
setConsoleOption
Description copied from interface:SystemRegistrySets the value of a console option.This method sets the value of the console option with the specified name. Console options are used to configure the behavior of the console and its components.
- Specified by:
setConsoleOptionin interfaceSystemRegistry- Overrides:
setConsoleOptionin classSystemRegistryImpl- Parameters:
name- the name of the option to setvalue- the value to assign to the option
-