public abstract class MethodInjector<T> extends SingleMemberInjector<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
MethodInjector.ByMethodName |
static class |
MethodInjector.ByReflectionMethod |
SingleMemberInjector.ParameterCannotBeNullExceptionAbstractInjector.AmbiguousComponentResolutionException, AbstractInjector.CyclicDependencyException, AbstractInjector.NotConcreteRegistrationException, AbstractInjector.UnsatisfiableDependenciesExceptionComponentAdapter.NOTHINGparameters, verifyingGuard| Constructor and Description |
|---|
MethodInjector(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
String methodName,
boolean useNames)
Creates a MethodInjector
|
| Modifier and Type | Method and Description |
|---|---|
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 abstract Method |
getInjectorMethod() |
protected Object[] |
getMemberArguments(PicoContainer container,
Method method) |
protected boolean |
isNullParamAllowed(AccessibleObject member,
int i)
Checks to see if a null parameter is allowed in the given
constructor/field/method.
|
void |
verify(PicoContainer container)
Verify that all dependencies for this adapter can be satisfied.
|
boxParameters, getBindings, getMemberArguments, getParameter, getParanamer, nullCheckaccept, box, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, getComponentInstance, getDescriptor, newInstance, useNameschangeMonitor, checkTypeCompatibility, currentMonitor, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindAdapterOfType, getComponentImplementation, getComponentKey, getDelegatepublic MethodInjector(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, String methodName, 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 addAdaptermethodName - the method nameuseNames - use argument names when looking up dependenciesAbstractInjector.NotConcreteRegistrationException - if the implementation is not a concrete class.NullPointerException - if one of the parameters is nullprotected abstract Method getInjectorMethod()
public T getComponentInstance(PicoContainer container, Type into) throws PicoCompositionException
ComponentAdapterCached 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 Object[] getMemberArguments(PicoContainer container, Method method)
public Object decorateComponentInstance(PicoContainer container, Type into, T instance)
InjectordecorateComponentInstance in interface Injector<T>decorateComponentInstance in class AbstractInjector<T>container - the container that can provide injectable dependenciesinstance - the instance topublic void verify(PicoContainer container) throws PicoCompositionException
ComponentAdapterverify 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 boolean isNullParamAllowed(AccessibleObject member, int i)
SingleMemberInjectorisNullParamAllowed in class SingleMemberInjector<T>member - constructor method or fieldi - parameter #.Copyright © 2003-2014 Codehaus. All Rights Reserved.