com.atlassian.pageobjects.inject
Class AbstractInjectionConfiguration

java.lang.Object
  extended by com.atlassian.pageobjects.inject.AbstractInjectionConfiguration
All Implemented Interfaces:
InjectionConfiguration

@ExperimentalApi
public abstract class AbstractInjectionConfiguration
extends Object
implements InjectionConfiguration

Abstract implementation of InjectionConfiguration.

Since:
2.1

Nested Class Summary
protected static class AbstractInjectionConfiguration.InterfaceToImpl
           
protected static class AbstractInjectionConfiguration.InterfaceToInstance
           
 
Field Summary
protected  List<AbstractInjectionConfiguration.InterfaceToImpl> interfacesToImpls
           
protected  List<AbstractInjectionConfiguration.InterfaceToInstance> interfacesToInstances
           
 
Constructor Summary
AbstractInjectionConfiguration()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.pageobjects.inject.InjectionConfiguration
finish
 

Field Detail

interfacesToImpls

protected final List<AbstractInjectionConfiguration.InterfaceToImpl> interfacesToImpls

interfacesToInstances

protected final List<AbstractInjectionConfiguration.InterfaceToInstance> interfacesToInstances
Constructor Detail

AbstractInjectionConfiguration

public AbstractInjectionConfiguration()
Method Detail

addImplementation

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

Specified by:
addImplementation in interface InjectionConfiguration
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
public final <C,I extends C> InjectionConfiguration addSingleton(@Nonnull
                                                                         Class<C> type,
                                                                         @Nonnull
                                                                         I instance)
Description copied from interface: InjectionConfiguration
Add mapping from a type to a singleton instance of this type that shall be used for injection in given context.

Specified by:
addSingleton in interface InjectionConfiguration
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


Copyright © 2014 Atlassian. All rights reserved.