While reading the code example I assumed you would get an exception
because you bind IResourceSetProvider twice.
Anyways the thing you are looking for is Modules.override()
https://google.github.io/guice/api-docs/latest/javadoc/com/google/inject/util/Modules.html#override-com.google.inject.Module...-
On 19.07.2016 08:39, [email protected] wrote:
Hi guys,
Is there a way to provide custom binding in my own Module which will
override binding from other nested PrivateModule .
More precisely:
I have a module with implementation:
void configure() {
binder().install(new PrivateModule() {
@Override
protected void configure() {
bind(IResourceSetProvider.class).to(XtextResourceSetProvider.class);
bind(XtextResourceSet.class).to(SynchronizedXtextResourceSet.class);
expose(IResourceSetProvider.class);
}
});
}
I would like to provide my custom implementation for
IResourceSetProvider.class.
This is how I try to make it:
void configure(Binder binder) {
binder.bind(IResourceSetProvider.class).to(ExtXtextResourceSetProvider.class);
super.configure(binder);
}
When the IResourceSetProvider instance is injected it returns all the
time XtextResourceSetProvider. Is there any way to implement my module
to return ExtXtextResourceSetProvider?
Adam
--
You received this message because you are subscribed to the Google
Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/caa50ca8-bd15-4ed6-819d-9928ac6c3f17%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/caa50ca8-bd15-4ed6-819d-9928ac6c3f17%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/578E136E.3040909%40gmx.ch.
For more options, visit https://groups.google.com/d/optout.