Package io.fluentlenium.core.components
Class DefaultComponentInstantiator
java.lang.Object
io.fluentlenium.core.components.AbstractComponentInstantiator
io.fluentlenium.core.components.DefaultComponentInstantiator
- All Implemented Interfaces:
ComponentInstantiator
Default component instantiator.
-
Constructor Summary
ConstructorDescriptionDefaultComponentInstantiator
(FluentControl control) Creates a new component instantiator, using given fluent control.DefaultComponentInstantiator
(FluentControl control, ComponentInstantiator instantiator) Creates a new component instantiator, using given fluent control and underlying instantiator. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isComponentClass
(Class<?> componentClass) Check if this class is a component class.boolean
isComponentListClass
(Class<? extends List<?>> componentListClass) Check if this class is a component list class.<T> T
newComponent
(Class<T> componentClass, org.openqa.selenium.WebElement element) Create and register a new component of the provided type from the givenWebElement
.<L extends List<T>,
T>
LnewComponentList
(Class<L> listClass, Class<T> componentClass, List<T> componentsList) Create and register a new list of component from the given component list.Methods inherited from class io.fluentlenium.core.components.AbstractComponentInstantiator
asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newFluent, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList
-
Constructor Details
-
DefaultComponentInstantiator
Creates a new component instantiator, using given fluent control.- Parameters:
control
- control interface
-
DefaultComponentInstantiator
Creates a new component instantiator, using given fluent control and underlying instantiator.- Parameters:
control
- control interfaceinstantiator
- component instantiator
-
-
Method Details
-
isComponentClass
Description copied from interface:ComponentInstantiator
Check if this class is a component class.- Parameters:
componentClass
- class to check- Returns:
- true if this class is a component class, false otherwise
-
isComponentListClass
Description copied from interface:ComponentInstantiator
Check if this class is a component list class.- Parameters:
componentListClass
- class to check- Returns:
- true if this class is a component list class, false otherwise
-
newComponent
Description copied from interface:ComponentInstantiator
Create and register a new component of the provided type from the givenWebElement
.- Type Parameters:
T
- type of the component- Parameters:
componentClass
- type of the componentelement
- wrapped element- Returns:
- new instance of the component
-
newComponentList
public <L extends List<T>,T> L newComponentList(Class<L> listClass, Class<T> componentClass, List<T> componentsList) Description copied from interface:ComponentInstantiator
Create and register a new list of component from the given component list.- Type Parameters:
L
- type of the listT
- type of the component- Parameters:
listClass
- type of the listcomponentClass
- type of the componentcomponentsList
- components list- Returns:
- new list of components
-