Hi
I am looking at the built-in j.u.l.Logger injection and I want to create
something like it but for some other types. At least two pretty good
use-cases for a similar functionality come to mind:
- injecting java.util.prefs.Preferences. The instance to be used as the
injected value, just like with the j.u.l.Logger, can be also depend on the
class that contains the field to be injected.
- injecting some kind or recourses (java.util.ResourceBundle or similar
variants). Again the value to be injected can depend on the class that
contains the field to be injected.
Both tasks can be solved with a custom annotation and a type listener that
will look for that annotation and perform required injections.
But it is possible use the generic @Inject annotation and to register some
listener/injector/interceptor/something that will be called when there is no
registered binding for it?
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
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.