Class FluentInjector

java.lang.Object
io.fluentlenium.core.inject.FluentInjector
All Implemented Interfaces:
FluentInjectControl

public class FluentInjector extends Object implements FluentInjectControl
Handle injection of element proxies, Page objects, Parent objects and FindBy.

Excludes fields from injection that are marked as NoInject.

  • Constructor Details

    • FluentInjector

      public FluentInjector (FluentControl control, EventsRegistry eventsRegistry, ComponentsManager componentsManager, ContainerInstantiator instantiator)
      Creates a new injector.
      Parameters:
      control - control interface
      eventsRegistry - events registry
      componentsManager - components manager
      instantiator - container instantiator
  • Method Details

    • release

      public void release()
      Release all loaded containers.
    • newInstance

      public <T> T newInstance (Class<T> cls)
      Description copied from interface: FluentInjectControl
      Creates a new instance of a class inject it.
      Specified by:
      newInstance in interface FluentInjectControl
      Type Parameters:
      T - type of the object
      Parameters:
      cls - class of the object to create
      Returns:
      new container instance
      See Also:
    • inject

      public ContainerContext inject (Object container)
      Description copied from interface: FluentInjectControl
      Inject object with FluentLenium resources.
      Specified by:
      inject in interface FluentInjectControl
      Parameters:
      container - container to inject with FluentLenium resources
      Returns:
      The container context related to the injected container
    • injectComponent

      public ContainerContext injectComponent (Object componentContainer, Object parentContainer, org.openqa.selenium.SearchContext searchContext)
      Description copied from interface: FluentInjectControl
      Inject object with FluentLenium resources, using given search context and parent container.
      Specified by:
      injectComponent in interface FluentInjectControl
      Parameters:
      componentContainer - container to inject with FluentLenium resources
      parentContainer - parent container
      searchContext - search context to use for injection
      Returns:
      The container context related to the injected container