public class PatternTextMatcher extends Object implements TextMatcher
String values. Matching is perform by equality or by regular
expression matching.| Constructor and Description |
|---|
PatternTextMatcher(Pattern... patterns)
Creates a new
PatternTextMatcher. |
| Modifier and Type | Method and Description |
|---|---|
String |
description()
Returns "pattern" if this matcher contains only one pattern, or "patterns" if this matcher contains more than one
pattern.
|
String |
formattedValues()
Returns the regular expression patterns in this matcher, formatted as a single
String. |
boolean |
isMatching(String text)
Indicates whether the given text matches the regular expression patterns in this matcher.
|
public PatternTextMatcher(Pattern... patterns)
PatternTextMatcher.patterns - the regular expression patterns to match.NullPointerException - if the array of patterns is null.IllegalArgumentException - if the array of patterns is empty.public boolean isMatching(String text)
isMatching in interface TextMatchertext - the text to verify.true if the given text matches the Pattern values in this matcher,
false otherwise.NullPointerException - if any of the regular expressions is null.public String description()
description in interface TextMatcherpublic String formattedValues()
String.formattedValues in interface TextMatcherString.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.