Package org.picocontainer.injectors
Class SetterInjection
java.lang.Object
org.picocontainer.injectors.AbstractInjectionFactory
org.picocontainer.injectors.SetterInjection
- All Implemented Interfaces:
Serializable
,ComponentFactory
,InjectionFactory
A
InjectionFactory
for JavaBeans.
The factory creates SetterInjector
.- Author:
- Jörg Schaible
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSetterInjection
(String prefix) SetterInjection
(String prefix, String notThisOneThough) Specify a prefix and an exclusion -
Method Summary
Modifier and TypeMethodDescription<T> ComponentAdapter<T>
createComponentAdapter
(ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, Properties componentProperties, Object componentKey, Class<T> componentImplementation, Parameter... parameters) Create aSetterInjector
.Methods inherited from class org.picocontainer.injectors.AbstractInjectionFactory
accept, verify, wrapLifeCycle
-
Constructor Details
-
SetterInjection
-
SetterInjection
public SetterInjection() -
SetterInjection
Specify a prefix and an exclusion- Parameters:
prefix
- the prefix like 'set'notThisOneThough
- to exclude, like 'setMetaClass' for Groovy
-
-
Method Details
-
createComponentAdapter
public <T> ComponentAdapter<T> createComponentAdapter(ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, Properties componentProperties, Object componentKey, Class<T> componentImplementation, Parameter... parameters) throws PicoCompositionException Create aSetterInjector
.- Parameters:
monitor
-lifecycleStrategy
-componentProperties
-componentKey
- The component's keycomponentImplementation
- The class of the bean.parameters
- Any parameters for the setters. If null the adapter solves the dependencies for all setters internally. Otherwise the number parameters must match the number of the setter.- Returns:
- Returns a new
SetterInjector
. - Throws:
PicoCompositionException
- if dependencies cannot be solved
-
withInjectionOptional
-