Class ArgumentCompleter

java.lang.Object
jline.console.completer.ArgumentCompleter
All Implemented Interfaces:
Completer

public class ArgumentCompleter extends Object implements Completer
A Completer implementation that invokes a child completer using the appropriate separator argument. This can be used instead of the individual completers having to know about argument parsing semantics.
Since:
2.3
Author:
Marc Prud'hommeaux, Jason Dillon
  • Constructor Details

  • Method Details

    • setStrict

      public void setStrict(boolean strict)
      If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed.
    • isStrict

      public boolean isStrict()
      Returns whether a completion at argument index N will success if all the completions from arguments 0-(N-1) also succeed.
      Returns:
      True if strict.
      Since:
      2.3
    • getDelimiter

      public ArgumentCompleter.ArgumentDelimiter getDelimiter()
      Since:
      2.3
    • getCompleters

      public List<Completer> getCompleters()
      Since:
      2.3
    • complete

      public int complete(String buffer, int cursor, List<CharSequence> candidates)
      Description copied from interface: Completer
      Populates candidates with a list of possible completions for the buffer. The candidates list will not be sorted before being displayed to the user: thus, the complete method should sort the List before returning.
      Specified by:
      complete in interface Completer
      Parameters:
      buffer - The buffer
      cursor - The current position of the cursor in the buffer
      candidates - The List of candidates to populate
      Returns:
      The index of the buffer for which the completion will be relative