Package com.simsilica.lemur.text
Class TextFilters
java.lang.Object
com.simsilica.lemur.text.TextFilters
A collection of convenience filters for input and output.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalpha()
A character filter that only allows numeric digits.A character filter that only allows numeric digits.charFilter
(Predicate<Character> predicate) A character filter that skips characters that do not pass the specified predicate.charOutputTransform
(Function<Character, Character> transform) A text output transform that passes all characters through a character filter when passing them to the output string.constantTransform
(char c) A text output transform that replaces all characters in the string (including non-line feed whitespace) with the specified character.isDigit()
Returns a predicate that returns true for numeric digit characters as is passed to Character.isDigit().isInChars
(char... chars) Returns a predicate that returns true for any character in the specified list of characters.isLetter()
Returns a predicate that returns true for letter characters as is passed to Character.isLetter().Returns a predicate that returns true for alpha or numeric characters is in Character.isLetterOrDigit().A text output transform that converts all characters to lower case in the output string.numeric()
A character filter that only allows numeric digits.A character filter that converts all passed characters to upper case using Character.toUpperCase().A character filter that converts all passed characters to upper case using Character.toUpperCase().A text output transform that converts all characters to upper case in the output string.
-
Constructor Details
-
Method Details
-
constantTransform
A text output transform that replaces all characters in the string (including non-line feed whitespace) with the specified character. This is useful for fields that must obscure the real data like password fields. -
upperCaseTransform
A text output transform that converts all characters to upper case in the output string. -
lowerCaseTransform
A text output transform that converts all characters to lower case in the output string. -
charOutputTransform
A text output transform that passes all characters through a character filter when passing them to the output string. Note: any character filters that skip characters will cause the standard DocumentModelFilter carat position to be inaccruate... ie: the user will see their cursor in the wrong place. For standard DocumentModelFilter usage, make sure the supplied filter always returns something for every character. -
alpha
A character filter that only allows numeric digits. -
numeric
A character filter that only allows numeric digits. -
alphaNumeric
A character filter that only allows numeric digits. -
charFilter
A character filter that skips characters that do not pass the specified predicate. -
toUpperCase
A character filter that converts all passed characters to upper case using Character.toUpperCase(). -
toLowerCase
A character filter that converts all passed characters to upper case using Character.toUpperCase(). -
isLetter
Returns a predicate that returns true for letter characters as is passed to Character.isLetter(). -
isDigit
Returns a predicate that returns true for numeric digit characters as is passed to Character.isDigit(). -
isLetterOrDigit
Returns a predicate that returns true for alpha or numeric characters is in Character.isLetterOrDigit(). -
isInChars
Returns a predicate that returns true for any character in the specified list of characters.
-