Package org.springframework.shell
Class CompletionContext
java.lang.Object
org.springframework.shell.CompletionContext
Represents the buffer context in which completion was triggered.
-
Constructor Summary
ConstructorsConstructorDescriptionCompletionContext(List<String> words, int wordIndex, int position, CommandRegistration commandRegistration, CommandOption commandOption) -
Method Summary
Modifier and TypeMethodDescriptioncommandOption(CommandOption commandOption) Return a copy of this context with given command option.commandRegistration(CommandRegistration commandRegistration) Return a copy of this context with given command registration.Return the whole word the cursor is in, ornullif the cursor is past the last word.drop(int nbWords) Return a copy of this context, as if the first nbWords were not presentintintgetWords()
-
Constructor Details
-
CompletionContext
public CompletionContext(List<String> words, int wordIndex, int position, CommandRegistration commandRegistration, CommandOption commandOption) - Parameters:
words- words in the buffer, excluding words for the command namewordIndex- the index of the word the cursor is inposition- the position inside the current word where the cursor is
-
-
Method Details
-
getWords
-
getWordIndex
public int getWordIndex() -
getPosition
public int getPosition() -
getCommandOption
-
getCommandRegistration
-
upToCursor
-
currentWord
Return the whole word the cursor is in, ornullif the cursor is past the last word. -
currentWordUpToCursor
-
drop
Return a copy of this context, as if the first nbWords were not present -
commandOption
Return a copy of this context with given command option. -
commandRegistration
Return a copy of this context with given command registration.
-