org.picocontainer.injectors
Class SingleMemberInjector<T>

java.lang.Object
  extended by org.picocontainer.adapters.AbstractAdapter<T>
      extended by org.picocontainer.injectors.AbstractInjector<T>
          extended by org.picocontainer.injectors.SingleMemberInjector<T>
All Implemented Interfaces:
Serializable, ComponentAdapter<T>, ComponentMonitorStrategy, Injector<T>
Direct Known Subclasses:
ConstructorInjector, MethodInjector

public abstract class SingleMemberInjector<T>
extends AbstractInjector<T>

Injection will happen in a single member function on the component.

Author:
Paul Hammant
See Also:
Serialized Form

Nested Class Summary
static class SingleMemberInjector.ParameterCannotBeNullException
           
 
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.AbstractInjector
parameters, verifyingGuard
 
Constructor Summary
SingleMemberInjector(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, boolean useNames)
           
 
Method Summary
protected  void boxParameters(Type[] parameterTypes)
           
protected  Annotation[] getBindings(Annotation[][] annotationss)
           
protected  Object[] getMemberArguments(PicoContainer container, AccessibleObject member, Type[] parameterTypes, Annotation[] bindings)
           
protected  Object getParameter(PicoContainer container, AccessibleObject member, int i, Type parameterType, Annotation binding, Parameter currentParameter, ComponentAdapter<?> injecteeAdapter)
           
protected  Paranamer getParanamer()
           
protected  boolean isNullParamAllowed(AccessibleObject member, int i)
          Checks to see if a null parameter is allowed in the given constructor/field/method.
protected  void nullCheck(AccessibleObject member, int i, ParameterNameBinding expectedNameBinding, Object result)
           
 
Methods inherited from class org.picocontainer.injectors.AbstractInjector
accept, box, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, decorateComponentInstance, getComponentInstance, getComponentInstance, getDescriptor, newInstance, useNames, verify
 
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

SingleMemberInjector

public SingleMemberInjector(Object componentKey,
                            Class componentImplementation,
                            Parameter[] parameters,
                            ComponentMonitor monitor,
                            boolean useNames)
Method Detail

getParanamer

protected Paranamer getParanamer()

getMemberArguments

protected Object[] getMemberArguments(PicoContainer container,
                                      AccessibleObject member,
                                      Type[] parameterTypes,
                                      Annotation[] bindings)

boxParameters

protected void boxParameters(Type[] parameterTypes)

getParameter

protected Object getParameter(PicoContainer container,
                              AccessibleObject member,
                              int i,
                              Type parameterType,
                              Annotation binding,
                              Parameter currentParameter,
                              ComponentAdapter<?> injecteeAdapter)

nullCheck

protected void nullCheck(AccessibleObject member,
                         int i,
                         ParameterNameBinding expectedNameBinding,
                         Object result)

isNullParamAllowed

protected boolean isNullParamAllowed(AccessibleObject member,
                                     int i)
Checks to see if a null parameter is allowed in the given constructor/field/method. The default version allows null if the target object is not a primitive type.

Parameters:
member - constructor method or field
i - parameter #.
Returns:
true if the null parameter might be allowed.

getBindings

protected Annotation[] getBindings(Annotation[][] annotationss)


Copyright © 2003-2010 Codehaus. All Rights Reserved.