Lazy dependency access
Fields annotated with@Inject(lazy=true)
will be resolved after the whole dependency tree was resolved. This way, when injecting these fields, each of the required dependencies are already resolved.
Note that, these fields will be null
in the constructor. If you want to use these fields after initialization, check out the Service lifecycles
section in the Advanced usage
category.
Note that lazily injected fields are not accessible in the constructor, as they are resolved after the dependency tree construction.
Last updated