Introduce specialized annotations for scoped injectors #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we use
ContributesInjector
for all cases where we do field/method injection: application, activity, service and view scopesInstead, we want to have specialized annotations (similar to ContributesFragment, etc) for these entities
Convention:
ContributesXyz => constructor injection. E.g ContributesFragment
ContributesXyzInjector => field/method injection. E.g ContributesActivityInjector. This is to avoid any confusion about whether these entities support constructor injection
Concern
ContributesXyzInjector
can be quite long. E.gContributesApplicationInjector
. So I decided to shorten this specific one toContributesAppInjector
. But I wonder if we can still find a better naming for them in generalFlexibility
This PR introduces a new AutoInjectorBinding meta-annotation, similar to the existing AutoScopedBinding (now renamed to AutoInstanceBinding). These annotations may be used outside of whetstone to mark user-land annotations so that they can be automatically processed by whetstone-compiler for either constructor (instance) or field/method (injector) injections. Note: this API is still marked as
InternalWhetstoneApi
for now