de.akquinet.jbosscc.needle.injection
Interface InjectionProvider<T>

Type Parameters:
T - - The type of the provided object.
 Example for javax.inject.Qualifier:
 
 public class InjectionProvider() {
        @Override
        public boolean verify(final InjectionTargetInformation information) {
         return information.getAnnotation(CurrentUser.class) != null;
        }
 
        @Override
        public Object getKey(final InjectionTargetInformation information) {
         return CurrentUser.class;
        }
 
        @Override
        public User getInjectedObject(final Class type) {
         return new User();
        }
 }
 
 
All Superinterfaces:
InjectionVerifier
All Known Implementing Classes:
DatabaseRule, DatabaseTestcase, DatabaseTestcase, DatabaseTestRule, DefaultMockInjectionProvider, MockProviderInjectionProvider, ResourceMockInjectionProvider

public interface InjectionProvider<T>
extends InjectionVerifier

Provides an instances of T and verifies an injection target.


Method Summary
 T getInjectedObject(Class<?> injectionPointType)
          Provides an instance of T.
 Object getKey(InjectionTargetInformation injectionTargetInformation)
          Returns a key object, which identifies the provided object.
 
Methods inherited from interface de.akquinet.jbosscc.needle.injection.InjectionVerifier
verify
 

Method Detail

getInjectedObject

T getInjectedObject(Class<?> injectionPointType)
Provides an instance of T.

Parameters:
injectionPointType - the type of the injection target.
Returns:
instance of T

getKey

Object getKey(InjectionTargetInformation injectionTargetInformation)
Returns a key object, which identifies the provided 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.