frjaeger220 / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Add support for collections as configuration parameters #128

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
How about:

bindConstant().annotatedWith(Foo.class).toCollection("A", "B', "C");

It should bind to any List<String>, Set<String>, etc with this annotation.

Original issue reported on code.google.com by bslesinsky on 5 Jul 2007 at 11:28

GoogleCodeExporter commented 9 years ago

Original comment by bslesinsky on 18 Nov 2007 at 3:37

GoogleCodeExporter commented 9 years ago
Yes, it will good idea, i also need to inject List of objects (also with 
injections),
like:
bind(new TypeLiteral<List<Foo>>(){}).toCollection(new Bar1(), new Bar2(), new 
Bar3());
and it will also inject Bar1, Bar2, Bar3 as it does for toInstance.

Is there any practice for better way to do it?

Original comment by andrey.v...@gmail.com on 5 Dec 2007 at 9:46

GoogleCodeExporter commented 9 years ago
Duplicate of issue 37.

Original comment by limpbizkit on 14 May 2008 at 4:14