com.atlassian.pageobjects.inject
Interface InjectionContext

All Known Subinterfaces:
ConfigurableInjectionContext
All Known Implementing Classes:
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(java.lang.Class<T> type)
          Get an instance of given type from context.
 void injectMembers(java.lang.Object targetInstance)
          Execute injection of fields on given targetInstance
 void injectStatic(java.lang.Class<?> targetClass)
          Execute injection of static fields on given targetClass.
 

Method Detail

getInstance

@Nonnull
<T> T getInstance(@Nonnull
                          java.lang.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:
java.lang.IllegalArgumentException - if instantiating given class according to JSR-330 rules was impossible

injectStatic

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

Parameters:
targetClass - class to inject into

injectMembers

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

Parameters:
targetInstance - instance to inject into


Copyright © 2013 Atlassian. All Rights Reserved.