de.akquinet.jbosscc.needle.injection
Class DefaultMockInjectionProvider

java.lang.Object
  extended by de.akquinet.jbosscc.needle.injection.DefaultMockInjectionProvider
All Implemented Interfaces:
InjectionProvider<Object>, InjectionVerifier
Direct Known Subclasses:
ResourceMockInjectionProvider

public class DefaultMockInjectionProvider
extends Object
implements InjectionProvider<Object>


Constructor Summary
DefaultMockInjectionProvider(Class<?> type, MockProvider mockProvider)
           
 
Method Summary
 Object getInjectedObject(Class<?> type)
          Provides an instance of T.
 Object getKey(InjectionTargetInformation injectionTargetInformation)
          Returns a key object, which identifies the provided object.
protected  Class<?> getType()
           
 boolean verify(InjectionTargetInformation injectionTargetInformation)
          Verifies the injection target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMockInjectionProvider

public DefaultMockInjectionProvider(Class<?> type,
                                    MockProvider mockProvider)
Method Detail

getInjectedObject

public Object getInjectedObject(Class<?> type)
Description copied from interface: InjectionProvider
Provides an instance of T.

Specified by:
getInjectedObject in interface InjectionProvider<Object>
Parameters:
type - the type of the injection target.
Returns:
instance of T

verify

public boolean verify(InjectionTargetInformation injectionTargetInformation)
Description copied from interface: InjectionVerifier
Verifies the injection target.

Specified by:
verify in interface InjectionVerifier
Parameters:
injectionTargetInformation - information about the injection point
Returns:
true, if the provided object is injectable to the given injection information, otherwise false.

getType

protected Class<?> getType()

getKey

public Object getKey(InjectionTargetInformation injectionTargetInformation)
Description copied from interface: InjectionProvider
Returns a key object, which identifies the provided object.

Specified by:
getKey in interface InjectionProvider<Object>
Parameters:
injectionTargetInformation - information about the injection point
Returns:
the key of the provided object
See Also:
NeedleTestcase.getInjectedObject(Object)


Copyright © 2013 akquinet AG. All Rights Reserved.