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 theStringvalues in this matcher, formatted as a singleString.booleanisMatching(String text) Indicates whether the given text matches theStringvalues in this matcher.private boolean
-
Field Details
-
values
-
-
Constructor Details
-
StringTextMatcher
Creates a newStringTextMatcher.- Parameters:
values- theStringvalues 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 theStringvalues in this matcher. Each value can be a regular expression.- Specified by:
isMatchingin interfaceTextMatcher- Parameters:
text- the text to verify.- Returns:
trueif the given text matches theStringvalues in this matcher,falseotherwise.
-
description
Returns "value" if this matcher contains only one value, or "values" if this matcher contains more than one value.- Specified by:
descriptionin interfaceTextMatcher- Returns:
- "value" if this matcher contains only one value, or "values" if this matcher contains more than one value.
-
formattedValues
Returns theStringvalues in this matcher, formatted as a singleString.- Specified by:
formattedValuesin interfaceTextMatcher- Returns:
- the
Stringvalues in this matcher, formatted as a singleString.
-
onlyOneValue
private boolean onlyOneValue()
-