Annotation Interface Produces
Methods annotated with Produces will be used to get the instance of a dependency.
The instances provided by producer methods are used to inject values to the fields inside a Interaction
that are annotated with Inject
. The access modifier of a producer method must be
public.
Classes containing producer methods will be found automatically on startup. They can also be registered via
DependencyInjector.registerProvider(Object)
Please note that this is only a very basic implementation of dependency injection and can only be used inside
interaction controller classes or custom Implementation
s. Furthermore, each type can only
have one producer. In other words you cannot register different instances of the same dependency.
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Whether jda-commands should ignore this method at indexing during startup.
-
Element Details
-
skipIndexing
boolean skipIndexingWhether jda-commands should ignore this method at indexing during startup. Useful if you wish to register your dependency providers manually by callingDependencyInjector.registerProvider(Object)
- Returns:
- Whether jda-commands should ignore this method, default
true
- Default:
false
-