Class AbstractCommandRegistry

    • Constructor Detail

      • AbstractCommandRegistry

        public AbstractCommandRegistry()
    • Method Detail

      • doHelpDesc

        public CmdDesc doHelpDesc​(java.lang.String command,
                                  java.util.List<java.lang.String> info,
                                  CmdDesc cmdDesc)
      • registerCommands

        public <T extends java.lang.Enum<T>> void registerCommands​(java.util.Map<T,​java.lang.String> commandName,
                                                                   java.util.Map<T,​CommandMethods> commandExecute)
      • registerCommands

        public void registerCommands​(java.util.Map<java.lang.String,​CommandMethods> commandExecute)
      • invoke

        public java.lang.Object invoke​(CommandRegistry.CommandSession session,
                                       java.lang.String command,
                                       java.lang.Object... args)
                                throws java.lang.Exception
        Description copied from interface: CommandRegistry
        Execute a command.
        Specified by:
        invoke in interface CommandRegistry
        Parameters:
        session - the data of the current command session
        command - the name of the command
        args - arguments of the command
        Returns:
        result of the command execution
        Throws:
        java.lang.Exception - in case of error
      • saveException

        public void saveException​(java.lang.Exception exception)
      • hasCommand

        public boolean hasCommand​(java.lang.String command)
        Description copied from interface: CommandRegistry
        Returns whether a command with the specified name is known to this registry.
        Specified by:
        hasCommand in interface CommandRegistry
        Parameters:
        command - the command name to test
        Returns:
        true if the specified command is registered
      • commandNames

        public java.util.Set<java.lang.String> commandNames()
        Description copied from interface: CommandRegistry
        Returns the command names known by this registry.
        Specified by:
        commandNames in interface CommandRegistry
        Returns:
        the set of known command names, excluding aliases
      • commandAliases

        public java.util.Map<java.lang.String,​java.lang.String> commandAliases()
        Description copied from interface: CommandRegistry
        Returns a map of alias-to-command names known by this registry.
        Specified by:
        commandAliases in interface CommandRegistry
        Returns:
        a map with alias keys and command name values
      • rename

        public <V extends java.lang.Enum<V>> void rename​(V command,
                                                         java.lang.String newName)
      • alias

        public void alias​(java.lang.String alias,
                          java.lang.String command)
      • compileCompleters

        public org.jline.reader.impl.completer.SystemCompleter compileCompleters()
        Description copied from interface: CommandRegistry
        Returns a SystemCompleter that can provide detailed completion information for all registered commands.
        Specified by:
        compileCompleters in interface CommandRegistry
        Returns:
        a SystemCompleter that can provide command completion for all registered commands
      • getCommandMethods

        public CommandMethods getCommandMethods​(java.lang.String command)
      • registeredCommand

        public java.lang.Object registeredCommand​(java.lang.String command)