java.lang.Object
atlantafx.base.util.SimpleMaskChar
-
Field Summary
Fields inherited from interface atlantafx.base.util.MaskChar
INPUT_MASK_ANY_NON_SPACE, INPUT_MASK_DIGIT, INPUT_MASK_DIGIT_0_TO_1, INPUT_MASK_DIGIT_0_TO_2, INPUT_MASK_DIGIT_0_TO_3, INPUT_MASK_DIGIT_0_TO_4, INPUT_MASK_DIGIT_0_TO_5, INPUT_MASK_DIGIT_0_TO_6, INPUT_MASK_DIGIT_0_TO_7, INPUT_MASK_DIGIT_0_TO_8, INPUT_MASK_DIGIT_NON_ZERO, INPUT_MASK_DIGIT_OR_LETTER, INPUT_MASK_DIGIT_ZERO, INPUT_MASK_HEX, INPUT_MASK_LETTER, UNDERSCORE
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleMaskChar
(Predicate<Character> matchExpr) Creates a SimpleMaskChar.SimpleMaskChar
(Predicate<Character> matchExpr, UnaryOperator<Character> transform) Creates a SimpleMaskChar.SimpleMaskChar
(Predicate<Character> matchExpr, UnaryOperator<Character> transform, char placeholder) Creates a SimpleMaskChar.SimpleMaskChar
(Predicate<Character> matchExpr, UnaryOperator<Character> transform, char placeholder, boolean fixed) Creates a SimpleMaskChar. -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleMaskChar
fixed
(char ch) A utility method for creating a fixed character - that is, the character used to represent the fixed part (a prefix or a suffix) of the input mask.char
Returns the placeholder for the mask character.boolean
isAllowed
(char ch) Returns "true" if the character is allowed, "false" otherwise.boolean
isFixed()
Returns whether character is fixed (prefix, suffix or separator).char
transform
(char ch) Transforms user input character before setting.
-
Constructor Details
-
SimpleMaskChar
-
SimpleMaskChar
Creates a SimpleMaskChar.- Parameters:
matchExpr
- The matching predicate that determines which characters are masked.transform
- The transformation function that is applied to input characters.- See Also:
-
SimpleMaskChar
public SimpleMaskChar(Predicate<Character> matchExpr, UnaryOperator<Character> transform, char placeholder) Creates a SimpleMaskChar.- Parameters:
matchExpr
- The matching predicate that determines which characters are masked.transform
- The transformation function that is applied to input characters.placeholder
- The placeholder character to use for masking.- See Also:
-
SimpleMaskChar
public SimpleMaskChar(Predicate<Character> matchExpr, UnaryOperator<Character> transform, char placeholder, boolean fixed) Creates a SimpleMaskChar.- Parameters:
matchExpr
- The matching predicate that determines which characters are masked.transform
- The transformation function that is applied to input characters. No transformation is applied by default.placeholder
- The placeholder character to use for masking. The default replacement is underscore character.fixed
- Boolean value indicating if the character is fixed or not. Default is false.
-
-
Method Details
-
isAllowed
-
transform
-
getPlaceholder
public char getPlaceholder()Returns the placeholder for the mask character.- Specified by:
getPlaceholder
in interfaceMaskChar
-
isFixed
-
fixed
A utility method for creating a fixed character - that is, the character used to represent the fixed part (a prefix or a suffix) of the input mask.
-