Comment #2 on issue 370 by sberlin: @CheckedProvides
http://code.google.com/p/google-guice/issues/detail?id=370

The attached patch adds some APIs so that you can do:

new AbstractModule() {
  public void configure() {
    ThrowingProviderBinder.install(this, binder());
  }

  @ThrowingProvides(MyThrowingProviderInterface.class)
  Foo foo(Factory dep1, Baz dep2) throws SomeException {
    return dep1.getOrThrowUsing(dep2);
  }
}

Scopes & annotations are fully supported. A "provides" variation of each test was added, and some new tests to make sure that the exceptions in the provider method match those in the ThrowingProvider interface.

It also cleans up some bits internally in ThrowingProviderBinder so that it uses binder.addError instead of throwing an exception if the ThrowingProvider interface isn't compliant.



Attachments:
        throwingProvides.txt  45.1 KB

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to google-guice-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to