Package org.picocontainer.injectors
Class TypedFieldInjector<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.TypedFieldInjector<T>
-
- All Implemented Interfaces:
java.io.Serializable
,ComponentAdapter<T>
,ComponentMonitorStrategy
,Injector<T>
public class TypedFieldInjector<T> extends AbstractFieldInjector<T>
Injection happens after instantiation, and fields are marked as injection points via a field type.- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description TypedFieldInjector(java.lang.Object key, java.lang.Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, java.lang.String classNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescriptor()
Get a string key descriptor of the component adapter for use in toString()protected void
initializeInjectionMembersAndTypeLists()
protected java.lang.Object
injectIntoMember(java.lang.reflect.AccessibleObject member, java.lang.Object componentInstance, java.lang.Object toInject)
protected boolean
isTypedForInjection(java.lang.reflect.Field field)
protected NameBinding
makeParameterNameImpl(java.lang.reflect.AccessibleObject member)
protected java.lang.Object
memberInvocationReturn(java.lang.Object lastReturn, java.lang.reflect.AccessibleObject member, java.lang.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 Detail
-
TypedFieldInjector
public TypedFieldInjector(java.lang.Object key, java.lang.Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, java.lang.String classNames)
-
-
Method Detail
-
initializeInjectionMembersAndTypeLists
protected void initializeInjectionMembersAndTypeLists()
- Overrides:
initializeInjectionMembersAndTypeLists
in classIterativeInjector<T>
-
isTypedForInjection
protected boolean isTypedForInjection(java.lang.reflect.Field field)
-
injectIntoMember
protected java.lang.Object injectIntoMember(java.lang.reflect.AccessibleObject member, java.lang.Object componentInstance, java.lang.Object toInject) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Specified by:
injectIntoMember
in classIterativeInjector<T>
- Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
-
getDescriptor
public java.lang.String 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
protected NameBinding makeParameterNameImpl(java.lang.reflect.AccessibleObject member)
- Overrides:
makeParameterNameImpl
in classIterativeInjector<T>
-
memberInvocationReturn
protected java.lang.Object memberInvocationReturn(java.lang.Object lastReturn, java.lang.reflect.AccessibleObject member, java.lang.Object instance)
- Specified by:
memberInvocationReturn
in classIterativeInjector<T>
-
-