Class SystemRegistryImpl

java.lang.Object
org.apache.groovy.groovysh.jline.SystemRegistryImpl
All Implemented Interfaces:
org.jline.builtins.ConsoleOptionGetter, org.jline.console.CommandRegistry, org.jline.console.SystemRegistry

public class SystemRegistryImpl extends Object implements org.jline.console.SystemRegistry
Aggregate command registries.
  • Field Details

    • parser

      protected final org.jline.reader.Parser parser
    • configPath

      protected final org.jline.builtins.ConfigurationPath configPath
    • workDir

      protected final Supplier<Path> workDir
  • Constructor Details

    • SystemRegistryImpl

      public SystemRegistryImpl(org.jline.reader.Parser parser, org.jline.terminal.Terminal terminal, Supplier<Path> workDir, org.jline.builtins.ConfigurationPath configPath)
  • Method Details

    • rename

      public void rename(SystemRegistryImpl.Pipe pipe, String name)
    • renameLocal

      public void renameLocal(String command, String newName)
    • getPipeNames

      public Collection<String> getPipeNames()
      Specified by:
      getPipeNames in interface org.jline.console.SystemRegistry
    • setCommandRegistries

      public void setCommandRegistries(org.jline.console.CommandRegistry... commandRegistries)
      Specified by:
      setCommandRegistries in interface org.jline.console.SystemRegistry
    • initialize

      public void initialize(File script)
      Specified by:
      initialize in interface org.jline.console.SystemRegistry
    • commandNames

      public Set<String> commandNames()
      Specified by:
      commandNames in interface org.jline.console.CommandRegistry
    • commandAliases

      public Map<String,String> commandAliases()
      Specified by:
      commandAliases in interface org.jline.console.CommandRegistry
    • consoleOption

      public Object consoleOption(String name)
      Specified by:
      consoleOption in interface org.jline.builtins.ConsoleOptionGetter
      Specified by:
      consoleOption in interface org.jline.console.SystemRegistry
    • consoleOption

      public <T> T consoleOption(String name, T defVal)
      Specified by:
      consoleOption in interface org.jline.builtins.ConsoleOptionGetter
      Specified by:
      consoleOption in interface org.jline.console.SystemRegistry
    • setConsoleOption

      public void setConsoleOption(String name, Object value)
      Specified by:
      setConsoleOption in interface org.jline.console.SystemRegistry
    • register

      public void register(String command, org.jline.console.CommandRegistry subcommandRegistry)
      Register subcommand registry
      Specified by:
      register in interface org.jline.console.SystemRegistry
      Parameters:
      command - main command
      subcommandRegistry - subcommand registry
    • commandInfo

      public List<String> commandInfo(String command)
      Specified by:
      commandInfo in interface org.jline.console.CommandRegistry
    • hasCommand

      public boolean hasCommand(String command)
      Specified by:
      hasCommand in interface org.jline.console.CommandRegistry
    • setGroupCommandsInHelp

      public void setGroupCommandsInHelp(boolean commandGroups)
    • groupCommandsInHelp

      public SystemRegistryImpl groupCommandsInHelp(boolean commandGroups)
    • isCommandOrScript

      public boolean isCommandOrScript(org.jline.reader.ParsedLine line)
      Specified by:
      isCommandOrScript in interface org.jline.console.SystemRegistry
    • isCommandOrScript

      public boolean isCommandOrScript(String command)
      Specified by:
      isCommandOrScript in interface org.jline.console.SystemRegistry
    • addCompleter

      public void addCompleter(org.jline.reader.Completer completer)
    • compileCompleters

      public org.jline.reader.impl.completer.SystemCompleter compileCompleters()
      Specified by:
      compileCompleters in interface org.jline.console.CommandRegistry
    • completer

      public org.jline.reader.Completer completer()
      Specified by:
      completer in interface org.jline.console.SystemRegistry
    • commandDescription

      public org.jline.console.CmdDesc commandDescription(List<String> args)
      Specified by:
      commandDescription in interface org.jline.console.CommandRegistry
    • setScriptDescription

      public void setScriptDescription(Function<org.jline.console.CmdLine,org.jline.console.CmdDesc> scriptDescription)
    • commandDescription

      public org.jline.console.CmdDesc commandDescription(org.jline.console.CmdLine line)
      Specified by:
      commandDescription in interface org.jline.console.SystemRegistry
    • invoke

      public Object invoke(String command, Object... args) throws Exception
      Specified by:
      invoke in interface org.jline.console.SystemRegistry
      Throws:
      Exception
    • terminal

      public org.jline.terminal.Terminal terminal()
      Specified by:
      terminal in interface org.jline.console.SystemRegistry
    • isCommandAlias

      public boolean isCommandAlias(String command)
      Specified by:
      isCommandAlias in interface org.jline.console.SystemRegistry
    • execute

      public Object execute(String line) throws Exception
      Specified by:
      execute in interface org.jline.console.SystemRegistry
      Throws:
      Exception
    • cleanUp

      public void cleanUp()
      Specified by:
      cleanUp in interface org.jline.console.SystemRegistry
    • trace

      public void trace(Throwable exception)
      Specified by:
      trace in interface org.jline.console.SystemRegistry
    • trace

      public void trace(boolean stack, Throwable exception)
      Specified by:
      trace in interface org.jline.console.SystemRegistry
    • close

      public void close()
      Specified by:
      close in interface org.jline.console.SystemRegistry
    • consoleEngine

      public org.jline.console.ConsoleEngine consoleEngine()