Interface MaskingCallback

All Known Implementing Classes:
SimpleMaskingCallback

public interface MaskingCallback
Callback used to mask parts of the line for sensitive input like passwords.

The MaskingCallback interface provides methods to transform the input line both for display purposes and for history storage. This allows applications to implement custom masking strategies for sensitive information, such as passwords, API keys, or other confidential data.

When a MaskingCallback is provided to the LineReader, it will be used to:

  • Transform the line before displaying it to the user (e.g., replacing password characters with asterisks)
  • Transform the line before storing it in the history (e.g., removing sensitive information)

A simple implementation is provided in SimpleMaskingCallback, which replaces all characters with a single mask character.

See Also: