- java.lang.Object
-
- org.jline.reader.impl.SimpleMaskingCallback
-
- All Implemented Interfaces:
MaskingCallback
public final class SimpleMaskingCallback extends Object implements MaskingCallback
SimpleMaskingCallbackthat will replace all the characters in the line with the given mask. If the given mask is equal toLineReaderImpl.NULL_MASKthen the line will be replaced with an empty String.
-
-
Constructor Summary
Constructors Constructor Description SimpleMaskingCallback(Character mask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdisplay(String line)Transforms the line before it is displayed so that some parts can be hidden.Stringhistory(String line)Transforms the line before storing in the history.
-
-
-
Constructor Detail
-
SimpleMaskingCallback
public SimpleMaskingCallback(Character mask)
-
-
Method Detail
-
display
public String display(String line)
Description copied from interface:MaskingCallbackTransforms the line before it is displayed so that some parts can be hidden.- Specified by:
displayin interfaceMaskingCallback- Parameters:
line- the current line being edited- Returns:
- the modified line to display
-
history
public String history(String line)
Description copied from interface:MaskingCallbackTransforms the line before storing in the history. If the return value is empty or null, it will not be saved in the history.- Specified by:
historyin interfaceMaskingCallback- Parameters:
line- the line to be added to history- Returns:
- the modified line
-
-