Package org.fest.swing.util
Class PatternTextMatcher
java.lang.Object
org.fest.swing.util.PatternTextMatcher
- 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 "pattern" if this matcher contains only one pattern, or "patterns" if this matcher contains more than one pattern.Returns the regular expression patterns in this matcher, formatted as a singleString.booleanisMatching(String text) Indicates whether the given text matches the regular expression patterns in this matcher.private boolean
-
Field Details
-
patterns
-
-
Constructor Details
-
PatternTextMatcher
Creates a newPatternTextMatcher.- Parameters:
patterns- the regular expression patterns to match.- Throws:
NullPointerException- if the array of patterns isnull.IllegalArgumentException- if the array of patterns is empty.
-
-
Method Details
-
isMatching
Indicates whether the given text matches the regular expression patterns in this matcher.- Specified by:
isMatchingin interfaceTextMatcher- Parameters:
text- the text to verify.- Returns:
trueif the given text matches thePatternvalues in this matcher,falseotherwise.- Throws:
NullPointerException- if any of the regular expressions isnull.
-
description
Returns "pattern" if this matcher contains only one pattern, or "patterns" if this matcher contains more than one pattern.- Specified by:
descriptionin interfaceTextMatcher- Returns:
- "pattern" if this matcher contains only one pattern, or "patterns" if this matcher contains more than one pattern.
-
formattedValues
Returns the regular expression patterns in this matcher, formatted as a singleString.- Specified by:
formattedValuesin interfaceTextMatcher- Returns:
- the regular expression patterns in this matcher, formatted as a single
String.
-
onlyOnePattern
private boolean onlyOnePattern()
-