Class CommandGroupAdapter

java.lang.Object
org.jline.console.impl.CommandGroupAdapter
All Implemented Interfaces:
org.jline.shell.CommandGroup

public class CommandGroupAdapter extends Object implements org.jline.shell.CommandGroup
Adapts an old CommandRegistry to the new CommandGroup interface.

This bridge allows existing command registries (e.g., Builtins, GroovyCommand) to be used with the new Shell and CommandDispatcher APIs.

Each command in the registry is wrapped as a Command that delegates execution back to CommandRegistry.invoke(CommandRegistry.CommandSession, String, Object...).

Since:
4.0
See Also:
  • Constructor Details

    • CommandGroupAdapter

      public CommandGroupAdapter(CommandRegistry registry)
      Creates an adapter wrapping the given command registry.
      Parameters:
      registry - the old command registry to adapt
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface org.jline.shell.CommandGroup
    • commands

      public Collection<org.jline.shell.Command> commands()
      Specified by:
      commands in interface org.jline.shell.CommandGroup