Annotation Interface Provides


@Documented @Retention(RUNTIME) @Target(METHOD) @Inherited public @interface Provides
Defines a zero-args non-static non-void method whose return value is made available for injection via a ProvidesResolver.

This annotation is Inherited, so it propagates from a superclass method to an overriding subclass method. Note that due to a JDK constraint, Inherited does not propagate from an interface method to its implementors; annotate the concrete method directly in that case.

Each call to ProvidesResolver.resolve(Dependency) invokes the annotated method afresh. The provider object is responsible for any memoization if singleton semantics are required.

Author:
reed.vonredwitz
See Also: