michaelwiles / google-gin

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

Convert constant bindings to all constant types #139

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When binding a value with toConstant(..), Gin should convert and inject any 
place where that constant is requested, *regardless of injection type*, as long 
as it's a constant type.

Example:

[in module]
bindConstant().annotatedWith(Names.named("foo").to("123");

[in some injected class]
@Inject
MyClass(@Named("foo") double foo) { ... }

Currently, Gin claims that the constant binding requested was not defined. 
Instead, it should parse the string value given above (if possible) and then 
inject it into MyClass. See also section on constant bindings at 
http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/Binder.ht
ml

Original issue reported on code.google.com by aragos on 21 Feb 2011 at 10:09