T
- the type of Component
supported by this matcher.public abstract class GenericTypeMatcher<T extends Component> extends AbstractComponentMatcher
ComponentMatcher
that matches a Component
by type and some
custom search criteria.Constructor and Description |
---|
GenericTypeMatcher(Class<T> supportedType)
Creates a new
GenericTypeMatcher . |
GenericTypeMatcher(Class<T> supportedType,
boolean requireShowing)
Creates a new
GenericTypeMatcher . |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
isMatching(T component)
Verifies that the given component matches some search criteria.
|
boolean |
matches(Component c)
Verifies that the given
:
Is an instance of the generic type specified in this
Matches some search criteria
|
Class<T> |
supportedType()
Returns the supported type of this matcher.
|
requireShowing, requireShowing, requireShowingMatches, reset
public GenericTypeMatcher(Class<T> supportedType)
GenericTypeMatcher
. The component to match does not have to be showing.supportedType
- the type supported by this matcher.NullPointerException
- if the given type is null
.public GenericTypeMatcher(Class<T> supportedType, boolean requireShowing)
GenericTypeMatcher
.supportedType
- the type supported by this matcher.requireShowing
- indicates if the component to match should be showing or not.NullPointerException
- if the given type is null
.@RunsInCurrentThread public final boolean matches(Component c)
Component
:
ComponentMatcher
Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.
c
- the Component
to verify.true
if the given Component
is an instance of the generic type of this matcher
and matches some search criteria. Otherwise, false
.public final Class<T> supportedType()
@RunsInCurrentThread protected abstract boolean isMatching(T component)
Note: Implementations of this method may not be guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
component
- the Component
to verify.true
if the given component matches the defined search criteria; otherwise, false
.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.