APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.org.jline.reader.impl.completer

public Class ArgumentCompleter

extends Object
implements Completer
Class Inheritance
All Implemented Interfaces
jdk.internal.org.jline.reader.Completer
Imports
java.util.ArrayList, .Arrays, .Collection, .Collections, .LinkedList, .List, .Objects, jdk.internal.org.jline.reader.Candidate, .Completer, .LineReader, .ParsedLine

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.
Authors
Marc Prud'hommeaux, Jason Dillon
Since
2.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final List<Completer>
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
ArgumentCompleter(final Collection<Completer>
The embedded completers
completers
)

Create a new completer.

public
ArgumentCompleter(final Completer...
The embedded completers
completers
)

Create a new completer.

Method Summary

Modifier and TypeMethod and Description
public void
complete(LineReader reader, ParsedLine line, final List<Candidate> candidates)

Implements jdk.internal.org.jline.reader.Completer.complete.

Populates candidates with a list of possible completions for the command line.

public List<Completer>

Returns:

The list of completers.
getCompleters
()

Returns the list of completers used inside this ArgumentCompleter.

public boolean

Returns:

True if strict.
isStrict
()

Returns whether a completion at argument index N will success if all the completions from arguments 0-(N-1) also succeed.

public void
setStrict(final boolean
the strict flag
strict
)

If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed.

public void
setStrictCommand(final boolean
the strictCommand flag
strictCommand
)

If true, a completion at argument index N will only succeed if all the completions from 1-(N-1) also succeed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

completersback to summary
private final List<Completer> completers
strictback to summary
private boolean strict
strictCommandback to summary
private boolean strictCommand

Constructor Detail

ArgumentCompleterback to summary
public ArgumentCompleter(final Collection<Completer> completers)

Create a new completer.

Parameters
completers:Collection<Completer>

The embedded completers

ArgumentCompleterback to summary
public ArgumentCompleter(final Completer... completers)

Create a new completer.

Parameters
completers:Completer[]

The embedded completers

Method Detail

completeback to summary
public void complete(LineReader reader, ParsedLine line, final List<Candidate> candidates)

Implements jdk.internal.org.jline.reader.Completer.complete.

Doc from jdk.internal.org.jline.reader.Completer.complete.

Populates candidates with a list of possible completions for the command line. The list of candidates will be sorted and filtered by the LineReader, so that the list of candidates displayed to the user will usually be smaller than the list given by the completer. Thus it is not necessary for the completer to do any matching based on the current buffer. On the contrary, in order for the typo matcher to work, all possible candidates for the word being completed should be returned.

getCompletersback to summary
public List<Completer> getCompleters()

Returns the list of completers used inside this ArgumentCompleter.

Returns:List<Completer>

The list of completers.

Since
2.3
isStrictback to summary
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:boolean

True if strict.

Since
2.3
setStrictback to summary
public void setStrict(final boolean strict)

If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed.

Parameters
strict:boolean

the strict flag

setStrictCommandback to summary
public void setStrictCommand(final boolean strictCommand)

If true, a completion at argument index N will only succeed if all the completions from 1-(N-1) also succeed.

Parameters
strictCommand:boolean

the strictCommand flag

jdk.internal.org.jline.reader.impl.completer back to summary

public Class ArgumentCompleter.ArgumentLine

extends Object
implements ParsedLine
Class Inheritance
  • java.lang.Object
  • jdk.internal.org.jline.reader.impl.completer.ArgumentCompleter.ArgumentLine
All Implemented Interfaces
jdk.internal.org.jline.reader.ParsedLine

Field Summary

Modifier and TypeField and Description
private final int
private final String

Constructor Summary

AccessConstructor and Description
public
ArgumentLine(String word, int cursor)

Method Summary

Modifier and TypeMethod and Description
public int
cursor()

Implements jdk.internal.org.jline.reader.ParsedLine.cursor.

The cursor position within the line.

public String
line()

Implements jdk.internal.org.jline.reader.ParsedLine.line.

The unparsed line.

public String
word()

Implements jdk.internal.org.jline.reader.ParsedLine.word.

The current word being completed.

public int
wordCursor()

Implements jdk.internal.org.jline.reader.ParsedLine.wordCursor.

The cursor position within the current word.

public int
wordIndex()

Implements jdk.internal.org.jline.reader.ParsedLine.wordIndex.

The index of the current word in the list of words.

public List<String>
words()

Implements jdk.internal.org.jline.reader.ParsedLine.words.

The list of words.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cursorback to summary
private final int cursor
wordback to summary
private final String word

Constructor Detail

ArgumentLineback to summary
public ArgumentLine(String word, int cursor)

Method Detail

cursorback to summary
public int cursor()

Implements jdk.internal.org.jline.reader.ParsedLine.cursor.

Doc from jdk.internal.org.jline.reader.ParsedLine.cursor.

The cursor position within the line.

Annotations
@Override
lineback to summary
public String line()

Implements jdk.internal.org.jline.reader.ParsedLine.line.

Doc from jdk.internal.org.jline.reader.ParsedLine.line.

The unparsed line.

Annotations
@Override
wordback to summary
public String word()

Implements jdk.internal.org.jline.reader.ParsedLine.word.

Doc from jdk.internal.org.jline.reader.ParsedLine.word.

The current word being completed. If the cursor is after the last word, an empty string is returned.

Annotations
@Override
wordCursorback to summary
public int wordCursor()

Implements jdk.internal.org.jline.reader.ParsedLine.wordCursor.

Doc from jdk.internal.org.jline.reader.ParsedLine.wordCursor.

The cursor position within the current word.

Annotations
@Override
wordIndexback to summary
public int wordIndex()

Implements jdk.internal.org.jline.reader.ParsedLine.wordIndex.

Doc from jdk.internal.org.jline.reader.ParsedLine.wordIndex.

The index of the current word in the list of words.

Annotations
@Override
wordsback to summary
public List<String> words()

Implements jdk.internal.org.jline.reader.ParsedLine.words.

Doc from jdk.internal.org.jline.reader.ParsedLine.words.

The list of words.

Annotations
@Override