This was submitted by Peter Kovac in an email to me...
Setter Injection:
==============
we are using this for setter injection (PicoRegistrar.java), abstractRegistrar and the interface should be modified too:
public void registerWithSetterInjection(Object key, Class clazz, Object ... parameters) {
SynchronizedComponentAdapter componentAdapter;
if (parameters.length == 0) {
componentAdapter = new SynchronizedComponentAdapter(new CachingComponentAdapter(new SetterInjectionComponentAdapter(key, clazz,null)));
} else {
componentAdapter = new SynchronizedComponentAdapter(new CachingComponentAdapter(new SetterInjectionComponentAdapter(key, clazz, picoParameters(parameters))));
}
picoContainer.registerComponent(componentAdapter);
}
registrar.register(Foo.class)
.setInjectionType(SETTER)
.register(Bar.class)
.setInjectionType(CONSTRUCTOR)
.register(Baz.class);