Hi -- my attention was drawn to this recently by a colleague. I'm not sure I
understand your use case: it looks like you expect to have object IDs baked
into your code, where more typically (I think) one would write a given
method to work on objects of one type but various IDs.
In any case, I've been doing something somewhat similar with Guice, which
might interest you or others. There's a binding annotation @Config, which is
used to inject the value of a configuration parameter:
@Inject
@Config("myConfigParam")
int myValue;
The injection is done by a ConfigModule, which is initialized with a set of
configuration parameters -- anything that looks like a Map<String, String>.
It doesn't require any extensions to Guice.
By the way, does your ProvisionListener work correctly for Provider
injection? I experimented with this some, and in the Provider case, I
couldn't figure out how to get at the annotation value (your byId).
Vance
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-guice/-/9I3hN36U4LsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.