Class DefaultComponentInstantiator

java.lang.Object
io.fluentlenium.core.components.AbstractComponentInstantiator
io.fluentlenium.core.components.DefaultComponentInstantiator
All Implemented Interfaces:
ComponentInstantiator

public class DefaultComponentInstantiator extends AbstractComponentInstantiator
Default component instantiator.
  • Constructor Details

    • 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 interface
      instantiator - component instantiator
  • Method Details

    • isComponentClass

      public boolean isComponentClass (Class<?> componentClass)
      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

      public boolean isComponentListClass (Class<? extends List<?>> componentListClass)
      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

      public <T> T newComponent (Class<T> componentClass, org.openqa.selenium.WebElement element)
      Description copied from interface: ComponentInstantiator
      Create and register a new component of the provided type from the given WebElement.
      Type Parameters:
      T - type of the component
      Parameters:
      componentClass - type of the component
      element - 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 list
      T - type of the component
      Parameters:
      listClass - type of the list
      componentClass - type of the component
      componentsList - components list
      Returns:
      new list of components