@Target(value=FIELD) @Retention(value=RUNTIME) public @interface Inject
Represents an annotation that, if attached, automatically fills fields with their dependencies when a module gets loaded. This will also result in a topological sorting of modules to (hopefully) prevent any dependency issues.
There are some special cases of "dependencies" that will get resolved automatically and handled differently. Some
of these special cases also take the from() parameter into account, if you want to get objects from other
modules (cross-dependency injection).
Logger - If the field is a logger this will be filled with a module-specific
logger instance. No cross-dependency injectionModuleInformation - Holds the current module's
information or the information of the specified one.| Modifier and Type | Optional Element and Description |
|---|---|
Class<? extends Module> |
from
If specified, this will get the object from another module instead (cross-dependency injection).
|
boolean |
optional
If specified, the object won't be injected and can be left at null, if it cannot be found.
|
Copyright © 2014–2015 MountainBlade. All rights reserved.