Package org.fluentlenium.core.hook
Class DefaultHookChainBuilder
- java.lang.Object
-
- org.fluentlenium.core.hook.DefaultHookChainBuilder
-
- All Implemented Interfaces:
HookChainBuilder
public class DefaultHookChainBuilder extends java.lang.Object implements HookChainBuilder
Builder of hook chains from element supplier, element locator supplier and hook definitions list.
-
-
Constructor Summary
Constructors Constructor Description DefaultHookChainBuilder(FluentControl control, ComponentInstantiator instantiator)
Creates a new default hook chain builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FluentHook>
build(java.util.function.Supplier<org.openqa.selenium.WebElement> elementSupplier, java.util.function.Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locator, java.util.function.Supplier<java.lang.String> toStringSupplier, java.util.List<HookDefinition<?>> hooks)
Build the hook chain.protected FluentHook<?>
newInstance(java.lang.Class<? extends FluentHook<?>> hookClass, FluentControl fluentControl, ComponentInstantiator instantiator, java.util.function.Supplier<org.openqa.selenium.WebElement> elementSupplier, java.util.function.Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, java.util.function.Supplier<java.lang.String> toStringSupplier, java.lang.Object options)
Creates a new hook instance.
-
-
-
Constructor Detail
-
DefaultHookChainBuilder
public DefaultHookChainBuilder(FluentControl control, ComponentInstantiator instantiator)
Creates a new default hook chain builder- Parameters:
control
- control interfaceinstantiator
- component instantiator
-
-
Method Detail
-
build
public java.util.List<FluentHook> build(java.util.function.Supplier<org.openqa.selenium.WebElement> elementSupplier, java.util.function.Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locator, java.util.function.Supplier<java.lang.String> toStringSupplier, java.util.List<HookDefinition<?>> hooks)
Description copied from interface:HookChainBuilder
Build the hook chain.- Specified by:
build
in interfaceHookChainBuilder
- Parameters:
elementSupplier
- element supplierlocator
- element locator suppliertoStringSupplier
- element toString supplierhooks
- list of hook definitions- Returns:
- hook chain
-
newInstance
protected FluentHook<?> newInstance(java.lang.Class<? extends FluentHook<?>> hookClass, FluentControl fluentControl, ComponentInstantiator instantiator, java.util.function.Supplier<org.openqa.selenium.WebElement> elementSupplier, java.util.function.Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, java.util.function.Supplier<java.lang.String> toStringSupplier, java.lang.Object options) throws java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.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:
java.lang.NoSuchMethodException
- if a matching method is not found.java.lang.IllegalAccessException
- if thisConstructor
object is enforcing Java language access control and the underlying constructor is inaccessible.java.lang.InstantiationException
- if the class that declares the underlying constructor represents an abstract class.java.lang.reflect.InvocationTargetException
- if the underlying constructor throws an exception.
-
-