Java Examples for org.picocontainer.injectors.AnnotatedFieldInjection
The following java examples will help you to understand the usage of org.picocontainer.injectors.AnnotatedFieldInjection. These source code samples are taken from different open source projects.
Example 1
| Project: sdif4j-master File: Pico2Test.java View source code |
private MutablePicoContainer createPicoContatiner() {
final MutablePicoContainer picoContainer = new PicoBuilder().withBehaviors(new OptInCaching()).withComponentFactory(new CompositeInjection(new AnnotatedFieldInjection(Inject.class))).build();
picoContainer.addComponent(PicoContainer.class, picoContainer);
picoContainer.as(Characteristics.CACHE).addComponent(Pico2InjectContext.class);
picoContainer.as(Characteristics.CACHE).addComponent(TestLazySingleton.class);
picoContainer.as(Characteristics.CACHE).addComponent(TestEagerSingleton.class);
picoContainer.addComponent(TestPrototype.class);
picoContainer.addComponent("key", "value");
return picoContainer;
}