com.atlassian.pageobjects.inject
Interface InjectionConfiguration

All Known Implementing Classes:
AbstractInjectionConfiguration

@ExperimentalApi
public interface InjectionConfiguration

'Builder'-style API for configuring ConfigurableInjectionContexts.

The modifications to configuration done via calling the 'add'-style methods are committed by calling

Since:
1.2

Method Summary
<I> InjectionConfiguration
addImplementation(Class<I> interfaceType, Class<? extends I> implementationType)
          Add mapping from interface to a concrete implementation.
<C,I extends C>
InjectionConfiguration
addSingleton(Class<C> type, I instance)
          Add mapping from a type to a singleton instance of this type that shall be used for injection in given context.
 ConfigurableInjectionContext finish()
          

Finish the configuration and retrieve the resulting injection context instance.

 

Method Detail

addImplementation

@Nonnull
<I> InjectionConfiguration addImplementation(@Nonnull
                                                     Class<I> interfaceType,
                                                     @Nonnull
                                                     Class<? extends I> implementationType)
Add mapping from interface to a concrete implementation.

Type Parameters:
I - type parameter of the interface
Parameters:
interfaceType - specifies the interface
implementationType - specifies the implementation of interfaceType
Returns:
this configuration module

addSingleton

@Nonnull
<C,I extends C> InjectionConfiguration addSingleton(@Nonnull
                                                            Class<C> type,
                                                            @Nonnull
                                                            I instance)
Add mapping from a type to a singleton instance of this type that shall be used for injection in given context.

Type Parameters:
C - type component of the component
I - type parameter of the implementing instance
Parameters:
type - component type
instance - implementing singleton instance
Returns:
this configuration module

finish

@Nonnull
ConfigurableInjectionContext finish()

Finish the configuration and retrieve the resulting injection context instance.

The resulting instance might be the same instance that this configuration object was originally retrieved from, or a new instance with updated configuration - depending on the mutability of the injection context implementation.

Returns:
the resulting injection context


Copyright © 2014 Atlassian. All rights reserved.