Package org.fluentlenium.core.components
Class DefaultComponentInstantiator
- java.lang.Object
-
- org.fluentlenium.core.components.AbstractComponentInstantiator
-
- org.fluentlenium.core.components.DefaultComponentInstantiator
-
- All Implemented Interfaces:
ComponentInstantiator
public class DefaultComponentInstantiator extends AbstractComponentInstantiator
Default component instantiator.
-
-
Constructor Summary
Constructors Constructor Description DefaultComponentInstantiator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisComponentClass(java.lang.Class<?> componentClass)Check if this class is a component class.booleanisComponentListClass(java.lang.Class<? extends java.util.List<?>> componentListClass)Check if this class is a component list class.<T> TnewComponent(java.lang.Class<T> componentClass, org.openqa.selenium.WebElement element)Create and register a new component from the given element.<L extends java.util.List<T>,T>
LnewComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.util.List<T> componentsList)Create and register a new list of component from the given component list.-
Methods inherited from class org.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 Detail
-
DefaultComponentInstantiator
public DefaultComponentInstantiator(FluentControl control)
Creates a new component instantiator, using given fluent control.- Parameters:
control- control interface
-
DefaultComponentInstantiator
public DefaultComponentInstantiator(FluentControl control, ComponentInstantiator instantiator)
Creates a new component instantiator, using given fluent control and underlying instantiator.- Parameters:
control- control interfaceinstantiator- component instantiator
-
-
Method Detail
-
isComponentClass
public boolean isComponentClass(java.lang.Class<?> componentClass)
Description copied from interface:ComponentInstantiatorCheck if this class is a component class.- Parameters:
componentClass- class to check- Returns:
- true if this class is a component class, false otherwise
-
isComponentListClass
public boolean isComponentListClass(java.lang.Class<? extends java.util.List<?>> componentListClass)
Description copied from interface:ComponentInstantiatorCheck 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
public <T> T newComponent(java.lang.Class<T> componentClass, org.openqa.selenium.WebElement element)Description copied from interface:ComponentInstantiatorCreate and register a new component from the given element.- 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 java.util.List<T>,T> L newComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.util.List<T> componentsList)Description copied from interface:ComponentInstantiatorCreate 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
-
-