Class ConsoleDispatcherBuilder

java.lang.Object
org.jline.console.impl.ConsoleDispatcherBuilder

public class ConsoleDispatcherBuilder extends Object
Factory that creates a CommandDispatcher backed by the legacy console infrastructure (SystemRegistryImpl, Builtins, and optionally ConsoleEngineImpl).

This builder replaces the complex wiring that was previously in the old Shell class. It creates a dispatcher that uses the old console API internally while presenting the new CommandDispatcher interface.

Example:

 CommandDispatcher dispatcher = ConsoleDispatcherBuilder.builder()
     .terminal(terminal)
     .parser(parser)
     .builtins(builtins)
     .commands(myRegistry)
     .build();

 Shell shell = Shell.builder()
     .dispatcher(dispatcher)
     .build();
 shell.run();
 
Since:
4.0
See Also: