public abstract class IterativeInjector<T> extends AbstractInjector<T>
AbstractInjector.AmbiguousComponentResolutionException, AbstractInjector.CyclicDependencyException, AbstractInjector.NotConcreteRegistrationException, AbstractInjector.UnsatisfiableDependenciesException
ComponentAdapter.NOTHING
Modifier and Type | Field and Description |
---|---|
protected Annotation[] |
bindings |
protected List<AccessibleObject> |
injectionMembers |
protected Type[] |
injectionTypes |
parameters, verifyingGuard
Constructor and Description |
---|
IterativeInjector(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
boolean useNames)
Constructs a IterativeInjector
|
Modifier and Type | Method and Description |
---|---|
static String |
crudeMethodSignature(Method method) |
Object |
decorateComponentInstance(PicoContainer container,
Type into,
T instance)
A preexiting component instance can be injected into after instantiation
|
T |
getComponentInstance(PicoContainer container,
Type into)
Retrieve the component instance.
|
protected Constructor |
getConstructor() |
protected String |
getName(Method method) |
protected void |
initializeInjectionMembersAndTypeLists() |
protected abstract Object |
injectIntoMember(AccessibleObject member,
Object componentInstance,
Object toInject) |
protected boolean |
isInjectorMethod(Method method) |
protected NameBinding |
makeParameterNameImpl(AccessibleObject member) |
protected abstract Object |
memberInvocationReturn(Object lastReturn,
AccessibleObject member,
Object instance) |
protected abstract void |
unsatisfiedDependencies(PicoContainer container,
Set<Type> unsatisfiableDependencyTypes,
List<AccessibleObject> unsatisfiableDependencyMembers) |
void |
verify(PicoContainer container)
Verify that all dependencies for this adapter can be satisfied.
|
accept, box, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, getComponentInstance, getDescriptor, newInstance, useNames
changeMonitor, checkTypeCompatibility, currentMonitor, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate
protected transient List<AccessibleObject> injectionMembers
protected transient Type[] injectionTypes
protected transient Annotation[] bindings
public IterativeInjector(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, boolean useNames) throws AbstractInjector.NotConcreteRegistrationException
componentKey
- the search key for this implementationcomponentImplementation
- the concrete implementationparameters
- the parameters to use for the initializationmonitor
- the component monitor used by this addAdapteruseNames
- use argument names when looking up dependenciesAbstractInjector.NotConcreteRegistrationException
- if the implementation is not a concrete class.NullPointerException
- if one of the parameters is null
protected Constructor getConstructor()
protected NameBinding makeParameterNameImpl(AccessibleObject member)
protected abstract void unsatisfiedDependencies(PicoContainer container, Set<Type> unsatisfiableDependencyTypes, List<AccessibleObject> unsatisfiableDependencyMembers)
public T getComponentInstance(PicoContainer container, Type into) throws PicoCompositionException
ComponentAdapter
Cached
will always return the
same instance.getComponentInstance
in interface ComponentAdapter<T>
getComponentInstance
in class AbstractInjector<T>
container
- the PicoContainer
, that is used to resolve any possible dependencies of the instance.into
- the class that is about to be injected into. Use ComponentAdapter.NOTHING.class if this is not important to you.PicoCompositionException
- if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambiguous situation within the
container.protected abstract Object memberInvocationReturn(Object lastReturn, AccessibleObject member, Object instance)
public Object decorateComponentInstance(PicoContainer container, Type into, T instance)
Injector
decorateComponentInstance
in interface Injector<T>
decorateComponentInstance
in class AbstractInjector<T>
container
- the container that can provide injectable dependenciesinstance
- the instance toprotected abstract Object injectIntoMember(AccessibleObject member, Object componentInstance, Object toInject) throws IllegalAccessException, InvocationTargetException
public void verify(PicoContainer container) throws PicoCompositionException
ComponentAdapter
verify
in interface ComponentAdapter<T>
verify
in class AbstractInjector<T>
container
- the PicoContainer
, that is used to resolve any possible dependencies of the instance.PicoCompositionException
- if one or more dependencies cannot be resolved.protected void initializeInjectionMembersAndTypeLists()
public static String crudeMethodSignature(Method method)
protected boolean isInjectorMethod(Method method)
Copyright © 2003–2016 Codehaus. All rights reserved.