Hi,
Great stuff! I gave it a go with ModuleRewriter that automatically
adds a requestInjection for every interceptor that is bound. Simple.
ModuleWriter rewriter = new ModuleWriter() {
public void writeBindInterceptor(Binder binder,
InterceptorBinding interceptorBinding) {
super.writeBindInterceptor(binder,
interceptorBinding);
for (MethodInterceptor interceptor :
interceptorBinding.getInterceptors()) {
binder.requestInjection(interceptor);
}
}
};
Using the Binder from the param feels just like writing a plain
module.
Some wishes:
o) The ModuleWriter#create could also take existing module as param
instead of Elements so you don't see Element(s) at all. Or am I
missing something?
rewriter.create(Elements.getElements(myModule)) ->
rewriter.create(myModule)
o) In JavaDocs there could be some simple code snippets. When I saw
the unit test (ModuleRewriterTest) it made instant sense. Reading just
the method descriptions not so instant.
In any case, this SPI feels very intuitive.
Cheers,
Alen
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---