Package org.jline.console.impl
Class GogoCommandGroup
java.lang.Object
org.jline.console.impl.GogoCommandGroup
- All Implemented Interfaces:
CommandGroup
A
CommandGroup that wraps a legacy CommandRegistry's commands
as shell Commands.
This provides a migration path from the console module's CommandRegistry API
to the shell module's CommandGroup API. Each command in the registry
is wrapped as a shell Command that delegates to the registry's
CommandRegistry.invoke(CommandRegistry.CommandSession, String, Object...) method.
Example:
CommandRegistry registry = ...; // existing Gogo/console registry
dispatcher.addGroup(new GogoCommandGroup("Gogo", registry));
- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionGogoCommandGroup(String name, CommandRegistry registry) Creates a new GogoCommandGroup wrapping the given 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
-
GogoCommandGroup
Creates a new GogoCommandGroup wrapping the given registry.- Parameters:
name- the group nameregistry- the command registry to wrap
-
-
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
-