Class LineReaderImpl.CompletingWord

java.lang.Object
org.jline.reader.impl.LineReaderImpl.CompletingWord
All Implemented Interfaces:
CompletingParsedLine, ParsedLine
Enclosing class:
LineReaderImpl

private static class LineReaderImpl.CompletingWord extends Object implements CompletingParsedLine
  • Field Details

    • word

      private final String word
  • Constructor Details

    • CompletingWord

      public CompletingWord(String word)
  • Method Details

    • escape

      public CharSequence escape(CharSequence candidate, boolean complete)
      Description copied from interface: CompletingParsedLine
      Escapes a completion candidate according to the parser's quoting and escaping rules.

      This method ensures that special characters in the candidate are properly escaped or quoted according to the syntax rules of the parser, maintaining consistency with the current input line's quoting style.

      Specified by:
      escape in interface CompletingParsedLine
      Parameters:
      candidate - the completion candidate that may need escaping
      complete - true if this is a complete word, false if it's a partial completion
      Returns:
      the properly escaped/quoted candidate ready for insertion
    • rawWordCursor

      public int rawWordCursor()
      Description copied from interface: CompletingParsedLine
      Returns the cursor position within the raw (unprocessed) current word.

      Unlike ParsedLine.wordCursor(), this method returns the cursor position in the original word text, including any quotes and escape characters.

      Specified by:
      rawWordCursor in interface CompletingParsedLine
      Returns:
      the cursor position within the raw current word
    • rawWordLength

      public int rawWordLength()
      Description copied from interface: CompletingParsedLine
      Returns the length of the raw (unprocessed) current word.

      This is the length of the original word text, including any quotes and escape characters that may have been removed during parsing.

      Specified by:
      rawWordLength in interface CompletingParsedLine
      Returns:
      the length of the raw current word
    • word

      public String word()
      Description copied from interface: ParsedLine
      The current word being completed. If the cursor is after the last word, an empty string is returned.
      Specified by:
      word in interface ParsedLine
      Returns:
      the word being completed or an empty string
    • wordCursor

      public int wordCursor()
      Description copied from interface: ParsedLine
      The cursor position within the current word.
      Specified by:
      wordCursor in interface ParsedLine
      Returns:
      the cursor position within the current word
    • wordIndex

      public int wordIndex()
      Description copied from interface: ParsedLine
      The index of the current word in the list of words.
      Specified by:
      wordIndex in interface ParsedLine
      Returns:
      the index of the current word in the list of words
    • words

      public List<String> words()
      Description copied from interface: ParsedLine
      The list of words.
      Specified by:
      words in interface ParsedLine
      Returns:
      the list of words
    • line

      public String line()
      Description copied from interface: ParsedLine
      The unparsed line.
      Specified by:
      line in interface ParsedLine
      Returns:
      the unparsed line
    • cursor

      public int cursor()
      Description copied from interface: ParsedLine
      The cursor position within the line.
      Specified by:
      cursor in interface ParsedLine
      Returns:
      the cursor position within the line