org.picocontainer.injectors
Class SetterInjector
java.lang.Object
org.picocontainer.adapters.AbstractAdapter
org.picocontainer.injectors.AbstractInjector
org.picocontainer.injectors.IterativeInjector
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
| Methods inherited from class org.picocontainer.injectors.AbstractInjector |
accept, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, dispose, hasLifecycle, newInstance, start, stop |
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 implementationcomponentImplementation - the concrete implementationparameters - the parameters to use for the initializationmonitor - the component monitor used by this addAdapterlifecycleStrategy - the component lifecycle strategy used by this addAdaptersetterMethodPrefix -
- Throws:
AbstractInjector.NotConcreteRegistrationException - if the implementation is not a concrete class.
NullPointerException - if one of the parameters is null
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.