autowire

Autowire a constructor, field or a method.

Autowire a constructor, field or a method. To autowire a constructor simply call autowire with no template arguments. For autowiring a field or a method, call autowire with the name of field or argument as first template argument. Autowiring process will attempt to find all parameters by their name first, and by type afterwards, in order to inject the dependencies into the component. Failing to find a suitable candidate for injection, will fail in an exception during container instantiation. Note: There are no guarantees as of which method or constructor from an overload set will be selected as such it is advised to use autowire only on members that are not part of an overload set.

  1. Z autowire(Z factory)
  2. Z autowire(Z factory)
  3. Z autowire(Z factory)
    @safe
    Z
    autowire
    (
    string member
    Z : PropertyConfigurersAware!T
    T
    )
    if (
    isField!(T, member)
    )

Parameters

T

the component type

member

field or method of component T

factory Z

ConfigurationContextFactory where to inject the constructor or method configurer

Return Value

Type: Z

Z

Meta