Search in sources :

Example 1 with NullCompleter

use of jline.console.completer.NullCompleter in project hive by apache.

the class BeeLineCommandCompleter method getCompleters.

public static List<Completer> getCompleters(Iterable<CommandHandler> handlers) {
    List<Completer> completers = new LinkedList<Completer>();
    for (CommandHandler handler : handlers) {
        String[] commandNames = handler.getNames();
        if (commandNames != null) {
            for (String commandName : commandNames) {
                List<Completer> compl = new LinkedList<Completer>();
                compl.add(new StringsCompleter(BeeLine.COMMAND_PREFIX + commandName));
                compl.addAll(Arrays.asList(handler.getParameterCompleters()));
                // last param no complete
                compl.add(new NullCompleter());
                completers.add(new AggregateCompleter(compl.toArray(new Completer[compl.size()])));
            }
        }
    }
    return completers;
}
Also used : NullCompleter(jline.console.completer.NullCompleter) StringsCompleter(jline.console.completer.StringsCompleter) AggregateCompleter(jline.console.completer.AggregateCompleter) Completer(jline.console.completer.Completer) AggregateCompleter(jline.console.completer.AggregateCompleter) StringsCompleter(jline.console.completer.StringsCompleter) NullCompleter(jline.console.completer.NullCompleter) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 AggregateCompleter (jline.console.completer.AggregateCompleter)1 Completer (jline.console.completer.Completer)1 NullCompleter (jline.console.completer.NullCompleter)1 StringsCompleter (jline.console.completer.StringsCompleter)1