Package org.picocontainer.injectors
Class AnnotatedFieldInjector<T>
java.lang.Object
org.picocontainer.adapters.AbstractAdapter<T>
org.picocontainer.injectors.AbstractInjector<T>
org.picocontainer.injectors.IterativeInjector<T>
org.picocontainer.injectors.AbstractFieldInjector<T>
org.picocontainer.injectors.AnnotatedFieldInjector<T>
- All Implemented Interfaces:
Serializable
,ComponentAdapter<T>
,ComponentMonitorStrategy
,Injector<T>
Injection happens after instantiation, and through fields marked as injection points via an Annotation.
The default annotation of org.picocontainer.annotations.@Inject can be overridden.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.picocontainer.injectors.AbstractInjector
AbstractInjector.AmbiguousComponentResolutionException, AbstractInjector.CyclicDependencyException, AbstractInjector.NotConcreteRegistrationException, AbstractInjector.UnsatisfiableDependenciesException
Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter
ComponentAdapter.NOTHING
-
Field Summary
Fields inherited from class org.picocontainer.injectors.IterativeInjector
bindings, injectionMembers, injectionTypes
Fields inherited from class org.picocontainer.injectors.AbstractInjector
parameters, verifyingGuard
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedFieldInjector
(Object key, Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, Class<? extends Annotation> injectionAnnotation, boolean useNames) -
Method Summary
Modifier and TypeMethodDescriptionGet a string key descriptor of the component adapter for use in toString()protected void
protected Object
injectIntoMember
(AccessibleObject member, Object componentInstance, Object toInject) protected boolean
isAnnotatedForInjection
(Field field) protected NameBinding
protected Object
memberInvocationReturn
(Object lastReturn, AccessibleObject member, Object instance) Methods inherited from class org.picocontainer.injectors.AbstractFieldInjector
unsatisfiedDependencies
Methods inherited from class org.picocontainer.injectors.IterativeInjector
crudeMethodSignature, decorateComponentInstance, getComponentInstance, getConstructor, getName, isInjectorMethod, verify
Methods inherited from class org.picocontainer.injectors.AbstractInjector
accept, box, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, getComponentInstance, newInstance, useNames
Methods inherited from class org.picocontainer.adapters.AbstractAdapter
changeMonitor, checkTypeCompatibility, currentMonitor, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.picocontainer.ComponentAdapter
findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate
-
Constructor Details
-
AnnotatedFieldInjector
public AnnotatedFieldInjector(Object key, Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, Class<? extends Annotation> injectionAnnotation, boolean useNames)
-
-
Method Details
-
initializeInjectionMembersAndTypeLists
protected void initializeInjectionMembersAndTypeLists()- Overrides:
initializeInjectionMembersAndTypeLists
in classIterativeInjector<T>
-
isAnnotatedForInjection
-
injectIntoMember
protected Object injectIntoMember(AccessibleObject member, Object componentInstance, Object toInject) throws IllegalAccessException, InvocationTargetException - Specified by:
injectIntoMember
in classIterativeInjector<T>
- Throws:
IllegalAccessException
InvocationTargetException
-
getDescriptor
Description copied from interface:ComponentAdapter
Get a string key descriptor of the component adapter for use in toString()- Specified by:
getDescriptor
in interfaceComponentAdapter<T>
- Overrides:
getDescriptor
in classAbstractInjector<T>
- Returns:
- the descriptor
-
makeParameterNameImpl
- Overrides:
makeParameterNameImpl
in classIterativeInjector<T>
-
memberInvocationReturn
protected Object memberInvocationReturn(Object lastReturn, AccessibleObject member, Object instance) - Specified by:
memberInvocationReturn
in classIterativeInjector<T>
-