Package org.fest.swing.util
Class StringTextMatcher
java.lang.Object
org.fest.swing.util.StringTextMatcher
- All Implemented Interfaces:
TextMatcher
Understands matching text to a group of
String
values. Matching is perform by equality or by regular
expression matching.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns "value" if this matcher contains only one value, or "values" if this matcher contains more than one value.Returns theString
values in this matcher, formatted as a singleString
.boolean
isMatching
(String text) Indicates whether the given text matches theString
values in this matcher.private boolean
-
Field Details
-
values
-
-
Constructor Details
-
StringTextMatcher
Creates a newStringTextMatcher
.- Parameters:
values
- theString
values to match. Each value can be a regular expression.- Throws:
NullPointerException
- if the array of values isnull
.IllegalArgumentException
- if the array of values is empty.
-
-
Method Details
-
isMatching
Indicates whether the given text matches theString
values in this matcher. Each value can be a regular expression.- Specified by:
isMatching
in interfaceTextMatcher
- Parameters:
text
- the text to verify.- Returns:
true
if the given text matches theString
values in this matcher,false
otherwise.
-
description
Returns "value" if this matcher contains only one value, or "values" if this matcher contains more than one value.- Specified by:
description
in interfaceTextMatcher
- Returns:
- "value" if this matcher contains only one value, or "values" if this matcher contains more than one value.
-
formattedValues
Returns theString
values in this matcher, formatted as a singleString
.- Specified by:
formattedValues
in interfaceTextMatcher
- Returns:
- the
String
values in this matcher, formatted as a singleString
.
-
onlyOneValue
private boolean onlyOneValue()
-