T - the type of Component supported by this matcher.public abstract class NamedComponentMatcherTemplate<T extends Component> extends GenericTypeMatcher<T>
| Modifier and Type | Field and Description |
|---|---|
protected static Object |
ANY
Indicates that a property value to use as search criteria has not been set.
|
protected Object |
name
The component name to match.
|
| Modifier | Constructor and Description |
|---|---|
protected |
NamedComponentMatcherTemplate(Class<T> supportedType)
Creates a new
NamedComponentMatcherTemplate. |
protected |
NamedComponentMatcherTemplate(Class<T> supportedType,
Object name)
Creates a new
NamedComponentMatcherTemplate. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
arePropertyValuesMatching(Object expected,
Object actual)
Indicates whether the given value matches the expected value in this matcher.
|
protected boolean |
isNameMatching(String actual)
Indicates whether the given value matches the name in this matcher.
|
protected Object |
quoted(Object propertyValue)
Returns the given property value to match surrounded by double quotes.
|
protected Object |
quotedName()
Returns the component name to match surrounded by double quotes.
|
isMatching, matches, supportedTyperequireShowing, requireShowing, requireShowingMatches, resetprotected static final Object ANY
protected final Object name
protected NamedComponentMatcherTemplate(Class<T> supportedType)
NamedComponentMatcherTemplate.supportedType - the type supported by this matcher.NullPointerException - if the given type is null.protected NamedComponentMatcherTemplate(Class<T> supportedType, Object name)
NamedComponentMatcherTemplate.supportedType - the type supported by this matcher.name - the component name to match.NullPointerException - if the given type is null.protected final Object quotedName()
ANY. This method is commonly used in implementations of toString.ANY if the component name
has not been set.protected final Object quoted(Object propertyValue)
ANY. This method is commonly used in implementations of toString.propertyValue - the given property value.ANY if the property
value has not been set.protected final boolean isNameMatching(String actual)
true if this
matcher's name is ANY.actual - the actual component name.true if this matcher's name is ANY or if both the actual name is equal to the one
in this matcher. Otherwise false.protected final boolean arePropertyValuesMatching(Object expected, Object actual)
true if the expected value is ANYStrings, it checks for equality first. If this fails,
it tries to match the values assuming the expected value can be a regular expressionPattern and the actual value is a
CharSequence, regular expression matching is performedexpected - the expected value in this matcher.actual - the actual property value.true if the values match, otherwise false.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.