org.picocontainer.injectors
Class NamedFieldInjector

java.lang.Object
  extended by org.picocontainer.adapters.AbstractAdapter<T>
      extended by org.picocontainer.injectors.AbstractInjector<T>
          extended by org.picocontainer.injectors.IterativeInjector
              extended by org.picocontainer.injectors.NamedFieldInjector
All Implemented Interfaces:
Serializable, ComponentAdapter, ComponentMonitorStrategy, Injector, LifecycleStrategy

public class NamedFieldInjector
extends IterativeInjector

Injection happens after instantiation, and fields are marked as injection points via a named field.

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
lifecycleStrategy, parameters, verifyingGuard
 
Constructor Summary
NamedFieldInjector(Object key, Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, LifecycleStrategy lifecycleStrategy, String fieldNames)
           
 
Method Summary
 String getDescriptor()
          Get a string key descriptor of the component adapter.
protected  void initializeInjectionMembersAndTypeLists()
           
protected  void injectIntoMember(AccessibleObject member, Object componentInstance, Object toInject)
           
protected  boolean isNamedForInjection(Field field)
           
protected  NameBinding makeParameterNameImpl(AccessibleObject member)
           
 
Methods inherited from class org.picocontainer.injectors.IterativeInjector
decorateComponentInstance, getComponentInstance, getConstructor, getParanamer, isInjectorMethod, unsatisfiedDependencies, verify
 
Methods inherited from class org.picocontainer.injectors.AbstractInjector
accept, box, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, dispose, getComponentInstance, hasLifecycle, newInstance, start, stop, 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

NamedFieldInjector

public NamedFieldInjector(Object key,
                          Class<?> impl,
                          Parameter[] parameters,
                          ComponentMonitor componentMonitor,
                          LifecycleStrategy lifecycleStrategy,
                          String fieldNames)
Method Detail

initializeInjectionMembersAndTypeLists

protected void initializeInjectionMembersAndTypeLists()
Overrides:
initializeInjectionMembersAndTypeLists in class IterativeInjector

isNamedForInjection

protected boolean isNamedForInjection(Field field)

injectIntoMember

protected void injectIntoMember(AccessibleObject member,
                                Object componentInstance,
                                Object toInject)
                         throws IllegalAccessException,
                                InvocationTargetException
Specified by:
injectIntoMember in class IterativeInjector
Throws:
IllegalAccessException
InvocationTargetException

getDescriptor

public String getDescriptor()
Description copied from interface: ComponentAdapter
Get a string key descriptor of the component adapter.

Specified by:
getDescriptor in interface ComponentAdapter
Overrides:
getDescriptor in class AbstractInjector
Returns:

makeParameterNameImpl

protected NameBinding makeParameterNameImpl(AccessibleObject member)
Overrides:
makeParameterNameImpl in class IterativeInjector


Copyright © 2003-2010 Codehaus. All Rights Reserved.