-
- All Superinterfaces:
InputPrompt,Prompt
- All Known Implementing Classes:
DefaultPasswordPrompt
public interface PasswordPrompt extends InputPrompt
Interface for password prompts. A password prompt is like an input prompt but masks the input characters.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.CharactergetMask()Get the mask character to use for hiding input.default booleanshowMask()Whether to show the mask character in the post-input display result.-
Methods inherited from interface org.jline.prompt.InputPrompt
getCompleter, getDefaultValue, getLineReader, getValidator
-
Methods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
-
-
-
Method Detail
-
getMask
java.lang.Character getMask()
Get the mask character to use for hiding input. If null, uses the default mask character '*'.- Specified by:
getMaskin interfaceInputPrompt- Returns:
- the mask character, or null for default
-
showMask
default boolean showMask()
Whether to show the mask character in the post-input display result. Whentrue, the display result shows mask characters for each typed character. Whenfalse, the display result is empty (no visible feedback after input).Note: this controls only the post-input display value returned by
PromptResult.getDisplayResult(), not what is shown during typing. To suppress all visible feedback while typing, usemask('\0').- Returns:
- true to show mask characters in the result, false to hide completely
-
-