org.unitils.core.util
Interface ObjectToInjectHolder<T>

All Known Implementing Classes:
MockObject, PartialMockObject

public interface ObjectToInjectHolder<T>

An interface for replacing the object to inject with another object. During injection instead of injecting the current value, the getObjectToInject() method will be called to get the object that will be injected.

Author:
Filip Neven, Tim Ducheyne

Method Summary
 T getObjectToInject()
           
 Type getObjectToInjectType(Field field)
          Gets the type of the object to inject.
 

Method Detail

getObjectToInject

T getObjectToInject()
Returns:
The ojbect that should be injected instead of this object, can be null

getObjectToInjectType

Type getObjectToInjectType(Field field)
Gets the type of the object to inject. If this object was declared as an instance field, the field will be given as an argument. This can give more type information when generic types are being used.

Parameters:
field - The field that declared this object, null if there is no field
Returns:
The type, not null


Copyright © 2011. All Rights Reserved.