Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.0
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Since all the Guice stuff really saves me typing and allows me to write cleaner code (whethever this is a more or less a pure "IoC" approach), I decided to try adding annotations processing into pico as well as implicit binding. So far I implemented @Inject, @Singleton, @ImplementedBy.
public class Cat implements CatSoul {
@Inject
private Mouse mouse;
@Inject
private ExtendedPicoContainer container;
public Mouse getMouse()
{ return mouse; }public ExtendedPicoContainer getContainer()
{ return container; }}
@ImplementedBy(Cat.class)
public interface CatSoul {
public abstract Mouse getMouse();
}
and then you can write
ExtendedPicoContainer pico = new DefaultExtendedContainer();
CatSoul cat = pico.get(CatSoul.class);
assertNotNull(cat);
assertNotNull(cat.getMouse());
Activity
Mauro Talevi
made changes -
Field | Original Value | New Value |
---|---|---|
Key |
|
|
Project | PicoContainer Plugins [ 11080 ] | PicoContainer [ 10120 ] |
Erik Putrycz
made changes -
Attachment | picocontainer-src.patch [ 27179 ] |
Erik Putrycz
made changes -
Attachment | pom.xml.patch [ 27180 ] |
Mauro Talevi
made changes -
Assignee | Mauro Talevi [ maurotalevi ] |
Michael Rimov
made changes -
Status | Open [ 1 ] | Closed [ 6 ] |
Fix Version/s | 3.0 [ 14410 ] | |
Resolution | Fixed [ 1 ] |
Added to sandbox: https://svn.codehaus.org/picocontainer/java/sandbox/picocontainer-annotations/
A few changes:
Comments on the actual implementation and annotations should be done on the mailing list.