Module is.codion.swing.common.ui
Interface MaskFormatterBuilder
public interface MaskFormatterBuilder
Builds a
MaskFormatter
instance.-
Method Summary
Modifier and TypeMethodDescriptionallowsInvalid
(boolean allowsInvalid) build()
static MaskFormatterBuilder
builder()
commitsOnValidEdit
(boolean commitsOnValidEdit) emptyStringToNullValue
(boolean emptyStringToNullValue) If set to true thenMaskFormatter.stringToValue(String)
returns null when it encounters an empty string, instead of throwing aParseException
.invalidCharacters
(String invalidCharacters) invalidStringToNullValue
(boolean invalidStringToNullValue) If set to true thenMaskFormatter.stringToValue(String)
returns null when it encounters an unparsable string, instead of throwing aParseException
.overwriteMode
(boolean overwriteMode) placeholder
(String placeholder) placeholderCharacter
(char placeholderCharacter) validCharacters
(String validCharacters) valueContainsLiteralCharacters
(boolean valueContainsLiteralCharacters)
-
Method Details
-
mask
- Parameters:
mask
- the format mask string- Returns:
- this builder instance
- See Also:
-
valueContainsLiteralCharacters
- Parameters:
valueContainsLiteralCharacters
- true if the value should contain literal characters- Returns:
- this builder instance
- See Also:
-
placeholder
- Parameters:
placeholder
- the placeholder- Returns:
- this builder instance
- See Also:
-
placeholderCharacter
- Parameters:
placeholderCharacter
- the placeholder character- Returns:
- this builder instance
- See Also:
-
allowsInvalid
- Parameters:
allowsInvalid
- true if this field should allow invalid values- Returns:
- this builder instance
- See Also:
-
commitsOnValidEdit
- Parameters:
commitsOnValidEdit
- true if value should be committed on valid edit- Returns:
- this builder instance
- See Also:
-
validCharacters
- Parameters:
validCharacters
- the valid characters- Returns:
- this builder instance
- See Also:
-
invalidCharacters
- Parameters:
invalidCharacters
- the invalid characters- Returns:
- this builder instance
- See Also:
-
overwriteMode
- Parameters:
overwriteMode
- true if new characters should overwrite existing characters- Returns:
- this builder instance
- See Also:
-
emptyStringToNullValue
If set to true thenMaskFormatter.stringToValue(String)
returns null when it encounters an empty string, instead of throwing aParseException
.- Parameters:
emptyStringToNullValue
- if true then an empty string translates to a null value- Returns:
- this builder instance
- See Also:
-
invalidStringToNullValue
If set to true thenMaskFormatter.stringToValue(String)
returns null when it encounters an unparsable string, instead of throwing aParseException
.- Parameters:
invalidStringToNullValue
- if true then an unparsable string translates to a null value- Returns:
- this builder instance
- See Also:
-
build
- Returns:
- a new
MaskFormatter
instance based on this builder - Throws:
ParseException
- if the mask does not contain valid mask characters
-
builder
- Returns:
- a new
MaskFormatterBuilder
instance
-