Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultHookChainBuilder

        public DefaultHookChainBuilder​(FluentControl control,
                                       ComponentInstantiator instantiator)
        Creates a new default hook chain builder
        Parameters:
        control - control interface
        instantiator - 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 interface HookChainBuilder
        Parameters:
        elementSupplier - element supplier
        locator - element locator supplier
        toStringSupplier - element toString supplier
        hooks - 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 class
        fluentControl - control interface
        instantiator - component instantiator
        elementSupplier - element supplier
        locatorSupplier - element locator supplier
        toStringSupplier - element toString supplier
        options - hook options
        Returns:
        new hook instance
        Throws:
        java.lang.NoSuchMethodException - if a matching method is not found.
        java.lang.IllegalAccessException - if this Constructor 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.