Package org.jline.reader
JLine 3 Reader Package - Core components for building interactive command-line interfaces.
This package provides the fundamental interfaces and classes for creating interactive command-line applications with features such as:
- Line editing with customizable key bindings
- Command history navigation
- Tab completion with pluggable completion strategies
- Customizable syntax highlighting
- Password masking
- Custom prompt rendering
- Command parsing and tokenization
The main entry point is the LineReader
interface, which can be
instantiated using the LineReaderBuilder
. The LineReader provides
methods to read input from the user with various customization options.
Key components in this package include:
LineReader
- The main interface for reading lines from the consoleLineReaderBuilder
- Builder for creating LineReader instancesParser
- Interface for parsing command lines into tokensCompleter
- Interface for providing tab-completion candidatesHighlighter
- Interface for syntax highlightingHistory
- Interface for command history management
- Since:
- 3.0
-
Interface Summary Interface Description Binding Marker interface for objects that can be bound to key sequences in a KeyMap.Buffer Represents the editable text buffer in the LineReader.Completer A completer is the mechanism by which tab-completion candidates will be resolved.CompletingParsedLine An extension ofParsedLine
that, being aware of the quoting and escaping rules of theParser
that produced it, knows if and how a completion candidate should be escaped/quoted.CompletionMatcher Interface for matching and filtering completion candidates.Editor Interface for launching external editors from within a JLine application.Expander The Expander interface provides functionality for expanding special syntax in command lines.Highlighter The Highlighter interface provides syntax highlighting functionality for the LineReader.History Console command history management interface.History.Entry Represents a single history entry containing a command line and its metadata.LineReader Read lines from the console, with input editing.MaskingCallback Callback used to mask parts of the line for sensitive input like passwords.ParsedLine ParsedLine
objects are returned by theParser
during completion or when accepting the line.Parser The Parser interface is responsible for parsing command lines into tokens.Widget A Widget represents an action that can be bound to a key sequence in the LineReader. -
Class Summary Class Description Candidate Represents a completion candidate for tab completion.LineReaderBuilder A builder for creating and configuringLineReader
instances.Macro A macro that executes a sequence of keystrokes when invoked.PrintAboveWriter Redirects aWriter
to aLineReader
'sLineReader.printAbove(String)
method, which draws output above the current prompt / input line.Reference A reference to aWidget
by name. -
Enum Summary Enum Description LineReader.Option LineReader.RegionType LineReader.SuggestionType Parser.ParseContext -
Exception Summary Exception Description EndOfFileException This exception is thrown byLineReader.readLine()
when user the user types ctrl-D).EOFError Exception thrown when parsing is incomplete due to unexpected end of input.SyntaxError Exception thrown when a syntax error is encountered during parsing.UserInterruptException This exception is thrown byLineReader.readLine()
when user interrupt handling is enabled and the user types the interrupt character (ctrl-C).