Package io.fluentlenium.core.inject
Class FluentInjector
java.lang.Object
io.fluentlenium.core.inject.FluentInjector
- All Implemented Interfaces:
FluentInjectControl
-
Constructor Summary
ConstructorsConstructorDescriptionFluentInjector
(FluentControl control, EventsRegistry eventsRegistry, ComponentsManager componentsManager, ContainerInstantiator instantiator) Creates a new injector. -
Method Summary
Modifier and TypeMethodDescriptionInject object with FluentLenium resources.injectComponent
(Object componentContainer, Object parentContainer, org.openqa.selenium.SearchContext searchContext) Inject object with FluentLenium resources, using given search context and parent container.<T> T
newInstance
(Class<T> cls) Creates a new instance of a class inject it.void
release()
Release all loaded containers.
-
Constructor Details
-
FluentInjector
public FluentInjector(FluentControl control, EventsRegistry eventsRegistry, ComponentsManager componentsManager, ContainerInstantiator instantiator) Creates a new injector.- Parameters:
control
- control interfaceeventsRegistry
- events registrycomponentsManager
- components managerinstantiator
- container instantiator
-
-
Method Details
-
release
public void release()Release all loaded containers. -
newInstance
Description copied from interface:FluentInjectControl
Creates a new instance of a class inject it.- Specified by:
newInstance
in interfaceFluentInjectControl
- Type Parameters:
T
- type of the object- Parameters:
cls
- class of the object to create- Returns:
- new container instance
- See Also:
-
inject
Description copied from interface:FluentInjectControl
Inject object with FluentLenium resources.- Specified by:
inject
in interfaceFluentInjectControl
- 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 interfaceFluentInjectControl
- Parameters:
componentContainer
- container to inject with FluentLenium resourcesparentContainer
- parent containersearchContext
- search context to use for injection- Returns:
- The container context related to the injected container
-