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
public class SimpleSystemRegistryImpl extends SystemRegistryImpl
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.UnknownCommandException
-
Nested classes/interfaces inherited from interface org.jline.console.CommandRegistry
CommandRegistry.CommandSession
-
Nested 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
Constructors Constructor Description SimpleSystemRegistryImpl(Parser parser, Terminal terminal, java.util.function.Supplier<java.nio.file.Path> workDir, ConfigurationPath configPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TconsoleOption(java.lang.String name, T defVal)Returns the value of a console option with a default value if the option doesn't exist.voidsetConsoleOption(java.lang.String name, java.lang.Object value)Sets the value of a console option.voidsetLineReader(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, renameLocal, setCommandRegistries, setGroupCommandsInHelp, setScriptDescription, terminal, trace, trace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jline.console.CommandRegistry
invoke, name
-
-
-
-
Constructor Detail
-
SimpleSystemRegistryImpl
public SimpleSystemRegistryImpl(Parser parser, Terminal terminal, java.util.function.Supplier<java.nio.file.Path> workDir, ConfigurationPath configPath)
-
-
Method Detail
-
setLineReader
public void setLineReader(LineReader lineReader)
-
consoleOption
public <T> T consoleOption(java.lang.String name, T defVal)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
public void setConsoleOption(java.lang.String name, java.lang.Object value)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
-
-