|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagecom.google.inject.daggeradapter
as colored differences. Deletions are shownlike 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.
A utility to adapt classes annotated with @dagger.Module such that their @dagger.Provides methods can be properly invoked by Guice to performtheir provisiontheir provision operations.Simple example:
{@codeGuice.createInjector(...other modules..., DaggerAdapter.from(new SomeDaggerAdapter())); }Some notes on usage and compatibility.
@author cgruber@google.com (Christian Gruber)
- Dagger provider methods have a "SET_VALUES" provision mode not supported by Guice.
- MapBindings are not yet implemented (pending).
- Be careful about stateful modules. In contrast to Dagger (where components
areare expected to beexpectedtoberecreated on-demand with new Module instances), Guicetypicallytypicallyhas a single injector withaa long lifetime, so your module instance will beusedusedthroughout the lifetime of theentireentireapp.app.- Dagger 1.x uses @Singleton for all scopes, including shorter-lived
scopesscopes likelikeper-request or per-activity.Using modules written with Dagger 1.xusageusage in mind may resultinmindmayresultin mis-scoped objects.- Dagger 2.x supports custom scope annotations, but for use in Guice, a custom scope
implementation must be registered in order to support the custom lifetime ofthatthat annotation.