Package org.jline.console.impl
Class CommandGroupAdapter
java.lang.Object
org.jline.console.impl.CommandGroupAdapter
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCommandGroupAdapter(CommandRegistry registry) Creates an adapter wrapping the given command registry. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jline.shell.CommandGroup
command, hasCommand
-
Constructor Details
-
CommandGroupAdapter
Creates an adapter wrapping the given command registry.- Parameters:
registry- the old command registry to adapt
-
-
Method Details
-
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
Description copied from interface:CommandGroupReturns all commands in this group.- Specified by:
commandsin interfaceCommandGroup- Returns:
- the collection of commands, never null
-