org.picocontainer.injectors
Class SetterInjector

java.lang.Object
  extended by org.picocontainer.adapters.AbstractAdapter
      extended by org.picocontainer.injectors.AbstractInjector
          extended by org.picocontainer.injectors.IterativeInjector
              extended by org.picocontainer.injectors.SetterInjector
All Implemented Interfaces:
Serializable, ComponentAdapter, ComponentMonitorStrategy, LifecycleStrategy
Direct Known Subclasses:
AnnotatedMethodInjector

public class SetterInjector
extends IterativeInjector

Instantiates components using empty constructors and Setter Injection. For easy setting of primitive properties, also see PropertyApplicator.

Note that this class doesn't cache instances. If you want caching, use a Cached around this one.

Author:
Aslak Hellesøy, Jörg Schaible, Mauro Talevi, Paul Hammant
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
 
Field Summary
 
Fields inherited from class org.picocontainer.injectors.IterativeInjector
injectionMembers, injectionTypes
 
Fields inherited from class org.picocontainer.injectors.AbstractInjector
lifecycleStrategy, parameters, verifyingGuard
 
Constructor Summary
SetterInjector(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, String setterMethodPrefix)
          Constructs a SetterInjector
 
Method Summary
protected  String getInjectorPrefix()
           
protected  boolean isInjectorMethod(Method method)
           
 String toString()
           
 
Methods inherited from class org.picocontainer.injectors.IterativeInjector
getComponentInstance, getConstructor, getOrMakeInstance, initializeInjectionMembersAndTypeLists, injectIntoMember, unsatisfiedDependencies, verify
 
Methods inherited from class org.picocontainer.injectors.AbstractInjector
accept, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, dispose, hasLifecycle, newInstance, start, stop
 
Methods inherited from class org.picocontainer.adapters.AbstractAdapter
changeMonitor, checkTypeCompatibility, currentMonitor, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetterInjector

public SetterInjector(Object componentKey,
                      Class componentImplementation,
                      Parameter[] parameters,
                      ComponentMonitor monitor,
                      LifecycleStrategy lifecycleStrategy,
                      String setterMethodPrefix)
               throws AbstractInjector.NotConcreteRegistrationException
Constructs a SetterInjector

Parameters:
componentKey - the search key for this implementation
componentImplementation - the concrete implementation
parameters - the parameters to use for the initialization
monitor - the component monitor used by this addAdapter
lifecycleStrategy - the component lifecycle strategy used by this addAdapter
setterMethodPrefix -
Throws:
AbstractInjector.NotConcreteRegistrationException - if the implementation is not a concrete class.
NullPointerException - if one of the parameters is null
Method Detail

isInjectorMethod

protected boolean isInjectorMethod(Method method)
Overrides:
isInjectorMethod in class IterativeInjector

getInjectorPrefix

protected String getInjectorPrefix()

toString

public String toString()
Overrides:
toString in class AbstractAdapter
Returns:
Returns the ComponentAdapter's class name and the component's key.
See Also:
Object.toString()


Copyright © 2003-2007 Codehaus. All Rights Reserved.