bindSingleton
Allows to bind a singleton to the chosen class.
Parameters
will be converted to a provider that always returns the same instance. If no type argument is passed, it will be bind to its own class.
Throws
if provider for the selected type is already defined.
Allows to bind a singleton to the chosen class.
Parameters
inlined. Immediately invoked a single time. Its result will be registered as a singleton.
Throws
if provider for the selected type is already defined.
Automatically creates and registers an instance of Type with reflection. All required constructor parameters will be extracted from Context and must be present before calling this method.
Return
the constructed Type instance with injected dependencies.
Parameters
reified type of the provided instance. This class must have a single constructor.
Throws
if any of the dependencies are missing.
when unable to construct an instance.
Allows to bind a singleton instance to multiple classes in its hierarchy.
Parameters
list of interfaces and classes in the class hierarchy of the singleton. Any time any of the passed classes will be requested for injection, the selected singleton will be returned.
instance of class compatible with the passed types.
Throws
if provider for any of the selected types is already defined.
Allows to bind the result of the provider to multiple classes in its hierarchy.
Parameters
list of interfaces and classes in the class hierarchy of the provider. Any time any of the passed classes will be requested for injection, the selected provider will be returned.
inlined. Immediately invoked a single time. Its result will be registered as a singleton.
Throws
if provider for any of the selected types is already defined.