Generated by
JDiff

com.google.inject.throwingproviders Documentation Differences

This file contains all the changes in documentation in the package com.google.inject.throwingproviders as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class CheckedProvider

Alternative to the Guice com.google.inject.Provider that throws throws a checked Exception. Users may not inject {@code T} directly.

This interface must be extended to use application-specific exception types. SuchSuch subinterfaces may not define new methods, but may narrow the exception type.

 public interface RemoteProvider<T> extends CheckedProvider<T> { 
   T get() throws CustomExceptionOne, CustomExceptionTwo;
 }
 

When this type is bound using ThrowingProviderBinder, the value returned returned or exceptionexception thrown by .get will be scoped. As a consequence, .get will invoked at most onceonce within each scope. @since 3.0


Class CheckedProvides

Annotates methods of a com.google.inject.Module to create a a CheckedProvider method binding that can throw exceptions. The The method's return type is bound to a CheckedProvider that can be be injected. Guice will pass dependencies to the method as parameters. Install Install {@literal @}CheckedProvides methods by using using ThrowingProviderBinder.forModule(com.google.inject.Module) on the the module where the methods areare declared. @author sameb@google.com (Sam Berlin) @since 3.0

Class ThrowingInject

A version of {@literal @}Inject designed for ThrowingProviders. Use by:
ThrowingProviderBinder.create(binder())
    .bind(RemoteProvider.class, Customer.class)
    .providing(CustomerImpl.class);
 
where CustomerImpl has a constructor annotated with ThrowingInject. @author sameb@google.com (Sam Berlin) @since 4.0

Class ThrowingProvider

Alternative to the Guice com.google.inject.Provider that throws throws a checked Exception. Users may not inject {@code T} directly.

This interface must be extended to use application-specific exception types. SuchSuch subinterfaces may not define new methods:

 public interface RemoteProvider<T> extends ThrowingProvider<T, RemoteException> { }
 

When this type is bound using ThrowingProviderBinder, the value returned returned or exceptionexception thrown by .get will be scoped. As a consequence, .get will invoked at most onceonce within each scope. @author jmourits@google.com (Jerome Mourits) @author jessewilson@google.com (Jesse Wilson) @deprecated use CheckedProvider instead.


Class ThrowingProviderBinder

Builds a binding for a CheckedProvider.

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() {
     install(ThrowingProviderBinder.installforModule(this, binder());
   }
   


   {@literal @}CheckedProvides(RemoteProvider.class)
   {@literal @}RequestScope
   Customer provideCustomer(FlakyCustomerCreator creator) throws RemoteException {
     return creator.getCustomerOrThrow();
   }
 }
 
You also can declare that a CheckedProvider construct construct a particular class whose constructor throwsthrows an exception:
ThrowingProviderBinder.create(binder())
    .bind(RemoteProvider.class, Customer.class)
    .providing(CustomerImpl.class)
    .in(RequestScope.class);
 
@author jmourits@google.com (Jerome Mourits) @author jessewilson@google.com (Jesse Wilson) @author sameb@google.com (Sam Berlin)
Class ThrowingProviderBinder, Module forModule(Module)

Returns a module that installs {@literal @}CheckedProvides methods. @since 3.0