Class ArgumentCompleter
java.lang.Object
jline.console.completer.ArgumentCompleter
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstract implementation of a delimiter that uses theArgumentCompleter.AbstractArgumentDelimiter.isDelimiter(CharSequence, int)method to determine if a particular character should be used as a delimiter.static interfaceTheArgumentCompleter.ArgumentDelimiterallows custom breaking up of aStringinto individual arguments in order to dispatch the arguments to the nestedCompleter.static classThe result of a delimited buffer.static classArgumentCompleter.ArgumentDelimiterimplementation that counts all whitespace (as reported byCharacter.isWhitespace(char)) as being a delimiter. -
Constructor Summary
ConstructorsConstructorDescriptionArgumentCompleter(List<Completer> completers) Create a new completer with the defaultArgumentCompleter.WhitespaceArgumentDelimiter.ArgumentCompleter(ArgumentCompleter.ArgumentDelimiter delimiter, Collection<Completer> completers) Create a new completer with the specified argument delimiter.ArgumentCompleter(ArgumentCompleter.ArgumentDelimiter delimiter, Completer... completers) Create a new completer with the specified argument delimiter.ArgumentCompleter(Completer... completers) Create a new completer with the defaultArgumentCompleter.WhitespaceArgumentDelimiter. -
Method Summary
Modifier and TypeMethodDescriptionintcomplete(String buffer, int cursor, List<CharSequence> candidates) Populates candidates with a list of possible completions for the buffer.booleanisStrict()Returns whether a completion at argument index N will success if all the completions from arguments 0-(N-1) also succeed.voidsetStrict(boolean strict) If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed.
-
Constructor Details
-
ArgumentCompleter
public ArgumentCompleter(ArgumentCompleter.ArgumentDelimiter delimiter, Collection<Completer> completers) Create a new completer with the specified argument delimiter.- Parameters:
delimiter- The delimiter for parsing argumentscompleters- The embedded completers
-
ArgumentCompleter
Create a new completer with the specified argument delimiter.- Parameters:
delimiter- The delimiter for parsing argumentscompleters- The embedded completers
-
ArgumentCompleter
Create a new completer with the defaultArgumentCompleter.WhitespaceArgumentDelimiter.- Parameters:
completers- The embedded completers
-
ArgumentCompleter
Create a new completer with the defaultArgumentCompleter.WhitespaceArgumentDelimiter.- Parameters:
completers- The embedded completers
-
-
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
- Since:
- 2.3
-
getCompleters
-
complete
-