public class

ThrowingProviderBinder

extends Object
java.lang.Object
   ↳ com.google.inject.throwingproviders.ThrowingProviderBinder

Class Overview

Builds a binding for a ThrowingProvider.

You can use a fluent API and custom providers:

ThrowingProviderBinder.create(binder())
    .bind(RemoteProvider.class, Customer.class)
    .to(RemoteCustomerProvider.class)
    .in(RequestScope.class);
 
or, you can use throwing provider methods:
class MyModule extends AbstractModule {
   configure() {
     ThrowingProviderBinder.install(this, binder());
   }
   
   @ThrowingProvides(RemoteProvider.class)
   @RequestScope
   Customer provideCustomer(FlakyCustomerCreator creator) throws RemoteException {
     return creator.getCustomerOrThrow();
   }
 }
 

Summary

Nested Classes
class ThrowingProviderBinder.SecondaryBinder<P extends ThrowingProvider>  
Public Methods
<P extends ThrowingProvider> SecondaryBinder<P> bind(Class<P> interfaceType, Type valueType)
static ThrowingProviderBinder create(Binder binder)
static void install(Module module, Binder binder)
Installs @ThrowingProvides methods.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public SecondaryBinder<P> bind (Class<P> interfaceType, Type valueType)

public static ThrowingProviderBinder create (Binder binder)

public static void install (Module module, Binder binder)

Installs @ThrowingProvides methods.