Class ReadlineBuilder
java.lang.Object
org.aesh.readline.ReadlineBuilder
Builder for creating and configuring Readline instances.
- Author:
- Ståle W. Pedersen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a configured Readline instance.static ReadlineBuilderbuilder()Creates a new ReadlineBuilder instance.completionHandler(CompletionHandler completionHandler) Sets the completion handler for tab completion.Sets the edit mode for the Readline instance.enableHistory(boolean enableHistory) Enables or disables history tracking.Sets the history implementation for the Readline instance.historyFile(String historyFile) Sets the file path for persistent history storage.historySize(int historySize) Sets the maximum number of history entries to retain.
-
Method Details
-
builder
Creates a new ReadlineBuilder instance.- Returns:
- a new builder instance
-
editMode
Sets the edit mode for the Readline instance.- Parameters:
editMode- the edit mode to use (e.g., Emacs or Vi mode)- Returns:
- this builder instance
-
history
Sets the history implementation for the Readline instance.- Parameters:
history- the history implementation to use- Returns:
- this builder instance
-
enableHistory
Enables or disables history tracking.- Parameters:
enableHistory- true to enable history, false to disable- Returns:
- this builder instance
-
historySize
Sets the maximum number of history entries to retain.- Parameters:
historySize- the maximum history size- Returns:
- this builder instance
-
historyFile
Sets the file path for persistent history storage.- Parameters:
historyFile- the path to the history file- Returns:
- this builder instance
-
completionHandler
Sets the completion handler for tab completion.- Parameters:
completionHandler- the completion handler to use- Returns:
- this builder instance
-
build
Builds and returns a configured Readline instance. If no edit mode is specified, a default one is created. If history is enabled but not specified, an in-memory or file-based history is created. If no completion handler is specified, a SimpleCompletionHandler is used.- Returns:
- a new configured Readline instance
-