Annotation Interface Provides


@Target(METHOD) @Retention(RUNTIME) @Documented public @interface Provides
Marks a method as a provider of beans for dependency injection.

This annotation can be used on static methods to programmatically create and configure beans that will be managed by the dependency injection container. It's particularly useful when the bean creation requires complex logic or when the bean needs to be configured based on runtime conditions.

Example usage:

 public class Providers {
     @Provides
     @Singleton
     public static Configuration provideConfiguration() {
         return Configuration.load();
     }
 }
 
Since:
4.0.0