Open GoogleCodeExporter opened 9 years ago
Patch.
Original comment by mathias....@gmail.com
on 6 Feb 2009 at 7:04
Attachments:
Just use bind(...).annotatedWith(...).toInstance() which is much more explicit
about the type being bound. With
getClass(), there's a lot of problems since the runtime class may not be
significant (such as anonymous inner
classes, etc.)
Original comment by limpbizkit
on 7 Feb 2009 at 1:31
And then what in the case where you don't know the value class? Imagine this:
for (Map.Entry<String, Object> param :
action.getDefinition().getParamDefaultsMap().entrySet()) {
bind(param.getValue().getClass()).annotatedWith(Names.named(param.getKey())).toI
nstance(param.getValue());
}
Original comment by mathias....@gmail.com
on 7 Feb 2009 at 1:33
your example using plain bind() statements is sufficient. We don't really want
to encourage folks to write
bindings that they don't know statically.
Original comment by limpbizkit
on 7 Feb 2009 at 5:01
Original issue reported on code.google.com by
mathias....@gmail.com
on 6 Feb 2009 at 7:03