@NotThreadSafe @Internal public final class InjectPageBinder extends Object implements PageBinder, ConfigurableInjectionContext
navigateToAndBind(Class, Object...))Inject, including privatePostInjectionProcessorWaitUntilValidateStateInitnavigateToAndBind(Class, Object...) method, the page's URL is retrieved and
navigated to via Tester.gotoUrl(String) after construction and initializing but before WaitUntil
methods are called.
This class also implements a mutable variant of ConfigurableInjectionContext, where injection configuration
changes are applied in-place, by creating a new Guice injector.| Constructor and Description |
|---|
InjectPageBinder(ProductInstance productInstance,
Tester tester,
com.google.inject.Module... modules) |
| Modifier and Type | Method and Description |
|---|---|
<P> P |
bind(Class<P> pageClass,
Object... args)
Builds and binds the page object to the page.
|
InjectionConfiguration |
configure()
Get an injection configuration object that may be used to add/override objects in this injection context.
|
<P> DelayedBinder<P> |
delayedBind(Class<P> pageClass,
Object... args)
Creates a delayed binder that gives the caller full control over the lifecycle of the page object.
|
<T> T |
getInstance(Class<T> type)
Get an instance of given type from context.
|
<T> T |
inject(T target)
Execute injection of fields on
targetInstance |
void |
injectMembers(Object targetInstance)
Execute injection of fields on given targetInstance
|
com.google.inject.Injector |
injector()
Deprecated.
take advantage of
InjectionContext API instead. Scheduled for removal in 3.0 |
void |
injectStatic(Class<?> targetClass)
Execute injection of static fields on given targetClass.
|
<P extends Page> |
navigateToAndBind(Class<P> pageClass,
Object... args)
Constructs the page object, changes the browser URL to the desired page URL, then binds the object to the page.
|
<P> void |
override(Class<P> oldClass,
Class<? extends P> newClass)
Overrides a page object
|
protected void |
visitUrl(Page page) |
public InjectPageBinder(ProductInstance productInstance, Tester tester, com.google.inject.Module... modules)
@Deprecated public com.google.inject.Injector injector()
InjectionContext API instead. Scheduled for removal in 3.0public <P extends Page> P navigateToAndBind(Class<P> pageClass, Object... args)
PageBindernavigateToAndBind in interface PageBinderP - The page typepageClass - The page classargs - Arguments to pass to the page object constructor.public <P> P bind(Class<P> pageClass, Object... args)
PageBinderbind in interface PageBinderP - The page typepageClass - The page object classargs - Arguments to pass to the page object constructor.public <P> DelayedBinder<P> delayedBind(Class<P> pageClass, Object... args)
PageBinderDelayedBinder methods are called.delayedBind in interface PageBinderP - The page typepageClass - The page object classargs - The arguments to pass to the page object constructorpublic <P> void override(Class<P> oldClass, Class<? extends P> newClass)
PageBinderoverride in interface PageBinderP - The old class typeoldClass - The old class that would have normally been constructednewClass - An subclass of the old class to be substituted@Nonnull public <T> T getInstance(@Nonnull Class<T> type)
InjectionContextgetInstance in interface InjectionContextT - type paramtype - type of the requested instancepublic void injectStatic(@Nonnull Class<?> targetClass)
InjectionContextinjectStatic in interface InjectionContexttargetClass - class to inject intopublic void injectMembers(@Nonnull Object targetInstance)
InjectionContextinjectMembers in interface InjectionContexttargetInstance - instance to inject into@Nonnull public <T> T inject(@Nonnull T target)
InjectionContexttargetInstanceinject in interface InjectionContexttarget - instance to inject into@Nonnull public InjectionConfiguration configure()
ConfigurableInjectionContextconfigure in interface ConfigurableInjectionContextInjectionConfigurationCopyright © 2015 Atlassian. All rights reserved.