Implicitly injection pool
Implicitly injection pool
Provide dependency.
Provide dependency.
Variable type
Stored dependency object.
This refers to itself
This refers to itself
Get accessible dependencies.
Get accessible dependencies. You can detect errors that can not be assigned at compile time.
It is faster than com.phylage.scaladia.injector.ContainerAccessible.inject because of immediate assignment, but the dependency injected at compile time is determined, and this assignment can not be overwritten with "flush" or "narrow".
The scope to which this immediate assignment applies is all the same instances that inherit com.phylage.scaladia.injector.AutoInjectable.
Injection type
Container
Accessor (This refers to itself)
Get accessible dependencies.
Get accessible dependencies.
The type information is resolved at compile time, but the injection object is finalized at runtime. This function is slower than com.phylage.scaladia.injector.ContainerAccessible.confirm, but can be overwritten by flush or narrow.
Injection type
Container
Accessor (This refers to itself)
Gets an indexer for registering new dependencies.
Gets an indexer for registering new dependencies. By default, the dependency priority is set to maximum.
new dependency type
new dependency
Injection priority.
Manually register the new dependency.
Manually register the new dependency.
new dependency type
new dependency.
Injection priority.
Instantiates injectable objects and updates the pool with the current classpath.
Instantiates injectable objects and updates the pool with the current classpath. For example, if this is
inject[Runner].execute
, you do not need reify.
object Main extends App with RefreshInjection { reify { // Runner is an external dependency module. // The call to inject[X] internally, the implementation class of X is in the first-party module. println(Runner.execute) } }
inject[Runner].execute }}}
object Main extends App with RefreshInjection { reify { // Runner is an external dependency module. // The call to inject[X] internally, the implementation class of X is in the first-party module. println(Runner.execute) } }
result type
any function
Create a container shade.
Create a container shade.
Result type
Shaded container function.
Used to repool auto-injectable objects present in the current classpath.
Basic injection needs to be executed in the module to be started first. The declaration injected in the library has already completed macro expansion.
That is, when a third-party object accessed without injection tries to inject someone for the first time, higher priority objects in the current classpath may be ignored.
At that time, by inheriting RefreshInjection at a higher level, AutoInjectable in the class path will be pooled again.