|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.swing.core.AbstractComponentMatcher
org.fest.swing.core.GenericTypeMatcher<T>
org.fest.swing.core.matcher.NamedComponentMatcherTemplate<T>
T
- the type of Component
supported by this matcher.public abstract class NamedComponentMatcherTemplate<T extends Component>
Understands a template for matching components by name. Subclasses are free to add other properties to use as search criteria.
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
protected |
NamedComponentMatcherTemplate(Class<T> supportedType)
Creates a new NamedComponentMatcherTemplate . |
protected |
NamedComponentMatcherTemplate(Class<T> supportedType,
Object name)
Creates a new NamedComponentMatcherTemplate . |
Method Summary | |
---|---|
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. |
Methods inherited from class org.fest.swing.core.GenericTypeMatcher |
---|
isMatching, matches, supportedType |
Methods inherited from class org.fest.swing.core.AbstractComponentMatcher |
---|
requireShowing, requireShowing, requireShowingMatches, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Object ANY
protected final Object name
Constructor Detail |
---|
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
.Method Detail |
---|
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 ANY
String
s, 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 performed
expected
- the expected value in this matcher.actual
- the actual property value.
true
if the values match, otherwise false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |