Package io.fluentlenium.core.hook
Class DefaultHookChainBuilder
java.lang.Object
io.fluentlenium.core.hook.DefaultHookChainBuilder
- All Implemented Interfaces:
HookChainBuilder
Builder of hook chains from element supplier, element locator supplier and hook definitions list.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHookChainBuilder(FluentControl control, ComponentInstantiator instantiator) Creates a new default hook chain builder -
Method Summary
Modifier and TypeMethodDescriptionbuild(Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locator, Supplier<String> toStringSupplier, List<HookDefinition<?>> hooks) Build the hook chain.protected FluentHook<?>newInstance(Class<? extends FluentHook<?>> hookClass, FluentControl fluentControl, ComponentInstantiator instantiator, Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, Supplier<String> toStringSupplier, Object options) Creates a new hook instance.
-
Constructor Details
-
DefaultHookChainBuilder
Creates a new default hook chain builder- Parameters:
control- control interfaceinstantiator- component instantiator
-
-
Method Details
-
build
public List<FluentHook> build(Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locator, Supplier<String> toStringSupplier, List<HookDefinition<?>> hooks) Description copied from interface:HookChainBuilderBuild the hook chain.- Specified by:
buildin interfaceHookChainBuilder- Parameters:
elementSupplier- element supplierlocator- element locator suppliertoStringSupplier- element toString supplierhooks- list of hook definitions- Returns:
- hook chain
-
newInstance
protected FluentHook<?> newInstance(Class<? extends FluentHook<?>> hookClass, FluentControl fluentControl, ComponentInstantiator instantiator, Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, Supplier<String> toStringSupplier, Object options) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException Creates a new hook instance.- Parameters:
hookClass- hook classfluentControl- control interfaceinstantiator- component instantiatorelementSupplier- element supplierlocatorSupplier- element locator suppliertoStringSupplier- element toString supplieroptions- hook options- Returns:
- new hook instance
- Throws:
NoSuchMethodException- if a matching method is not found.IllegalAccessException- if thisConstructorobject is enforcing Java language access control and the underlying constructor is inaccessible.InstantiationException- if the class that declares the underlying constructor represents an abstract class.InvocationTargetException- if the underlying constructor throws an exception.
-