Class ReadlineBuilder

java.lang.Object
org.aesh.readline.ReadlineBuilder

public class ReadlineBuilder extends Object
Builder for creating and configuring Readline instances.
Author:
Ståle W. Pedersen
  • Method Details

    • builder

      public static ReadlineBuilder builder()
      Creates a new ReadlineBuilder instance.
      Returns:
      a new builder instance
    • editMode

      public ReadlineBuilder editMode(EditMode 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

      public ReadlineBuilder history(History history)
      Sets the history implementation for the Readline instance.
      Parameters:
      history - the history implementation to use
      Returns:
      this builder instance
    • enableHistory

      public ReadlineBuilder enableHistory(boolean enableHistory)
      Enables or disables history tracking.
      Parameters:
      enableHistory - true to enable history, false to disable
      Returns:
      this builder instance
    • historySize

      public ReadlineBuilder historySize(int historySize)
      Sets the maximum number of history entries to retain.
      Parameters:
      historySize - the maximum history size
      Returns:
      this builder instance
    • historyFile

      public ReadlineBuilder historyFile(String historyFile)
      Sets the file path for persistent history storage.
      Parameters:
      historyFile - the path to the history file
      Returns:
      this builder instance
    • completionHandler

      public ReadlineBuilder completionHandler(CompletionHandler completionHandler)
      Sets the completion handler for tab completion.
      Parameters:
      completionHandler - the completion handler to use
      Returns:
      this builder instance
    • build

      public Readline 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