public class FilterAcceptRegex extends Object implements TextFieldInputCharSequenceFilter
Constructor and Description |
---|
FilterAcceptRegex(Pattern expression)
Create a new instance of this class and set the pattern that is used for the test.
|
FilterAcceptRegex(String expression)
Create a new instance and set the regular expression used for the test.
|
FilterAcceptRegex(String expression,
int flags)
Create a new instance and set the regular expression that needs to be checked.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptInput(int index,
CharSequence newChars)
Check if the input of a new set of characters is acceptable.
|
public FilterAcceptRegex(Pattern expression)
expression
- the used patternpublic FilterAcceptRegex(String expression)
expression
- the regular expressionpublic FilterAcceptRegex(String expression, int flags)
expression
- the regular expressionflags
- Match flags, a bit mask that may include Pattern.CASE_INSENSITIVE
, Pattern.MULTILINE
,
Pattern.DOTALL
, Pattern.UNICODE_CASE
, Pattern.CANON_EQ
, Pattern.UNIX_LINES
, Pattern.LITERAL
and Pattern.COMMENTS
public boolean acceptInput(int index, CharSequence newChars)
TextFieldInputCharSequenceFilter
acceptInput
in interface TextFieldInputCharSequenceFilter
index
- the position within the text where the character is addednewChars
- the characters that is now about to be added to the texttrue
in case adding the character is allowedCopyright © 2013. All Rights Reserved.