-
public @interface InjectModule
Used to explicitly specify if it depends on externally provided beans or provides.External dependencies
Use
requiresto specify dependencies that will be provided externally.{@code // tell the annotation processor Pump and Grinder are provided externally // otherwise it will think we have missing dependencies at compile time
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringcustomScopeTypeInternal use only - identifies the custom scope annotation associated to this module.booleanignoreSingletonSet to true to ignore anything annotated with@Singleton.StringnameExplicitly specify the name of the module.Class<?>[]providesExplicitly define features that are provided by this module and required by other modules.Class<?>[]requiresThe dependencies that are provided externally or by other modules and that are required when wiring this module.Class<?>[]requiresPackagesDependencies in these packages are expected to be provided by other modules.
-
-
-
-
ignoreSingleton
boolean ignoreSingleton
Set to true to ignore anything annotated with@Singleton.Set this to true when some other library is using
@Singletonand we want avaje-inject to be completely independent of that by ignoring the standard@Singleton.We instead use
@Componentinstead of@Singleton.- Default:
- false
-
-
-
requires
Class<?>[] requires
The dependencies that are provided externally or by other modules and that are required when wiring this module.This effectively tells the annotation processor that these types are expected to be provided and to not treat them as missing dependencies. If we don't do this the annotation processor thinks the dependency is missing and will error the compilation saying there is a missing dependency.
- Default:
- {}
-
-
-
requiresPackages
Class<?>[] requiresPackages
Dependencies in these packages are expected to be provided by other modules.Instead of listing each and every dependency in
requireswe can use this to specify that any required dependency that is in these packages is expected to be provided by another module.Use this rather than
requireswhen there are lots of required dependencies, and we don't want to list each one inrequiresandprovides.- Default:
- {}
-
-
-
customScopeType
String customScopeType
Internal use only - identifies the custom scope annotation associated to this module.When a module is generated for a custom scope this is set to link the module back to the custom scope annotation and support partial compilation.
- Default:
- ""
-
-