com.atlassian.pageobjects.inject
Interface InjectionContext

All Known Subinterfaces:
ConfigurableInjectionContext, InjectingTestRule
All Known Implementing Classes:
ClassInjectionRule, InjectPageBinder

@ExperimentalApi
public interface InjectionContext

Simple interface for framework components capable of injection of components as described by JSR-330.

Since:
2.1

Method Summary
<T> T
getInstance(Class<T> type)
          Get an instance of given type from context.
 void injectMembers(Object targetInstance)
          Execute injection of fields on given targetInstance
 void injectStatic(Class<?> targetClass)
          Execute injection of static fields on given targetClass.
 

Method Detail

getInstance

@Nonnull
<T> T getInstance(@Nonnull
                          Class<T> type)
Get an instance of given type from context.

Type Parameters:
T - type param
Parameters:
type - type of the requested instance
Returns:
an instance of requested type. An exception may be raised if the context is unable to instantiate given type.
Throws:
IllegalArgumentException - if instantiating given class according to JSR-330 rules was impossible

injectStatic

void injectStatic(@Nonnull
                  Class<?> targetClass)
Execute injection of static fields on given targetClass.

Parameters:
targetClass - class to inject into

injectMembers

void injectMembers(@Nonnull
                   Object targetInstance)
Execute injection of fields on given targetInstance

Parameters:
targetInstance - instance to inject into


Copyright © 2014 Atlassian. All rights reserved.