Package org.jline.console.impl
Class CommandGroupAdapter
- java.lang.Object
-
- org.jline.console.impl.CommandGroupAdapter
-
- All Implemented Interfaces:
CommandGroup
public class CommandGroupAdapter extends java.lang.Object implements CommandGroup
Adapts an oldCommandRegistryto the newCommandGroupinterface.This bridge allows existing command registries (e.g.,
Builtins,GroovyCommand) to be used with the newShellandCommandDispatcherAPIs.Each command in the registry is wrapped as a
Commandthat delegates execution back toCommandRegistry.invoke(CommandRegistry.CommandSession, String, Object...).- Since:
- 4.0
- See Also:
CommandRegistryAdapter
-
-
Constructor Summary
Constructors Constructor Description CommandGroupAdapter(CommandRegistry registry)Creates an adapter wrapping the given command registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Command>commands()Returns all commands in this group.java.lang.Stringname()Returns the name of this command group.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jline.shell.CommandGroup
command, hasCommand
-
-
-
-
Constructor Detail
-
CommandGroupAdapter
public CommandGroupAdapter(CommandRegistry registry)
Creates an adapter wrapping the given command registry.- Parameters:
registry- the old command registry to adapt
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:CommandGroupReturns the name of this command group.The default implementation returns the simple class name.
- Specified by:
namein interfaceCommandGroup- Returns:
- the group name
-
commands
public java.util.Collection<Command> commands()
Description copied from interface:CommandGroupReturns all commands in this group.- Specified by:
commandsin interfaceCommandGroup- Returns:
- the collection of commands, never null
-
-