componentScan - multiple declarations

Function componentScan

Register an object into storage using annotations provided in it.

auto auto componentScan(T) (
  Storage!(ObjectFactory,string) storage,
  Locator!() locator,
  string id
);

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Parameters

NameDescription
T type of object to be registered
storage the storage where to register the object
locator the locator used to find object dependencies
id identity by which object will be stored in storage

Function componentScan

Register an object into storage by it's type FQN using annotations provided in it.

auto auto componentScan(T) (
  Storage!(ObjectFactory,string) storage,
  Locator!() locator
);

auto auto componentScan(T) (
  ConfigurableContainer storage
);

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Parameters

NameDescription
T type of object to be registered
storage the storage where to register the object

Function componentScan

Register an object into storage by I's interface FQN that it implements using annotations provided in it.

auto auto componentScan(I, T) (
  Storage!(ObjectFactory,string) storage,
  Locator!() locator
)
if (is(I == interface) && is(T == class) && is(T : I));

auto auto componentScan(I, T) (
  ConfigurableContainer storage
)
if (is(I == interface) && is(T == class) && is(T : I));

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Parameters

NameDescription
I the inteface that object implements.
T type of object to be registered
storage the storage where to register the object

Function componentScan

Register a set of objects by it's type, or implemented interface into a storage.

auto auto componentScan(T, V...) (
  Storage!(ObjectFactory,string) storage,
  Locator!() locator
);

auto auto componentScan(T, V...) (
  ConfigurableContainer storage
);

auto auto componentScan(I, T, V...) (
  Storage!(ObjectFactory,string) storage,
  Locator!() locator
)
if (is(I == interface) && is(T == class) && is(T : I));

auto auto componentScan(I, T, V...) (
  ConfigurableContainer storage
)
if (is(I == interface) && is(T == class) && is(T : I));

When registering an object by it's interface, next to interface it is required to specify the original type of object.

Note

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Parameters

NameDescription
I the inteface that object implements.
T type of object to be registered
storage the storage where to register the object

Function componentScan

Scan a module and register all public objects that are annotated with @component annotation.

auto auto componentScan(alias Module) (
  Storage!(ObjectFactory,string) storage,
  Locator!() locator
)
if (startsWith(Module.stringof, "module "));

auto auto componentScan(alias M) (
  ConfigurableContainer storage
)
if (startsWith(M.stringof, "module"));

Note

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Parameters

NameDescription
Module module to scan for components.
storage the storage where to register the object
locator the locator used to fetch registered object's dependencies.

Function componentScan

Scan a set of modules and register all public objects that are annotated with @component annotation.

auto auto componentScan(alias M, V...) (
  Storage!(ObjectFactory,string) storage,
  Locator!() locator
)
if (startsWith(M.stringof, "module"));

auto auto componentScan(alias M, V...) (
  ConfigurableContainer storage
)
if (startsWith(M.stringof, "module"));

Due to limitations of D language currently it is impossible to recursively scan all public imports of a module to register all depencies of a package. Each particular module should be specified in order to register dependencies.

Note

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Parameters

NameDescription
M current module to scan.
V rest set of modules waiting for scan.
storage the storage where to register the object
locator the locator used to fetch registered object's dependencies.

Function/Template componentScan

Register an object into a storage contained in storageLocator and identified by @container annotation using annotations provided in it.

auto auto componentScan(T, R) (
  R storageLocator,
  Locator!() locator,
  string id
)
if (!is(R : Storage!(ObjectFactory, string)));

auto auto componentScan(T, R) (
  R locator,
  string id
)
if (!is(R : Storage!(ObjectFactory, string)));

auto auto componentScan(T, R) (
  R storageLocator,
  Locator!() locator
)
if (!is(R : Storage!(ObjectFactory, string)));

auto auto componentScan(T, R) (
  R locator
)
if (!is(R : Storage!(ObjectFactory, string)));
template componentScan(T, V...) ;

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Function componentScan

Function componentScan

Function componentScan

Function componentScan

Template componentScan

Contained Functions

NameDescription
componentScan

Parameters

NameDescription
T type of object to be registered
storageLocator the locator from which to fetch storage for object
locator locator used to find dependencies for object
id identity by which object will be stored in storage

Function/Template componentScan

Register an object into a storage contained in storageLocator and identified by @container annotation using annotations provided in it.

auto auto componentScan(I, T, R) (
  R storageLocator,
  Locator!() locator
)
if (is(I == interface) && is(T == class) && is(T : I) && !is(R : Storage!(ObjectFactory, string)));

auto auto componentScan(I, T, R) (
  R locator
)
if (is(I == interface) && is(T == class) && is(T : I) && !is(R : Storage!(ObjectFactory, string)));
template componentScan(I, T, V...) ;

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Function componentScan

Function componentScan

Template componentScan

Contained Functions

NameDescription
componentScan

Parameters

NameDescription
I interface implemented by object, by which to register it.
T type of object to be registered
storageLocator locator used to find storage for object
locator locator used to find dependencies for object

Function/Template componentScan

Register module's objects into a storage contained in storageLocator and identified by @container annotation using annotations provided in it.

auto auto componentScan(alias M, R) (
  R storageLocator,
  Locator!() locator
)
if (M.stringof.startsWith("module ") && !is(R : Storage!(ObjectFactory, string)));

auto auto componentScan(alias M, R) (
  R locator
)
if (M.stringof.startsWith("module ") && !is(R : Storage!(ObjectFactory, string)));
template componentScan(alias M, V...) ;

An object will be registered in storage only in case when it is annotated with @component annotation. In case when no @component annotation is found, object is not registered in storage.

Function componentScan

Function componentScan

Template componentScan

Contained Functions

NameDescription
componentScan

Parameters

NameDescription
M module to scan for instantiable objects.
storageLocator locator used to find storage for objects
locator locator used to find object dependencies