autowire

Autowire a constructor, field or a method.

Autowire a constructor, field or a method. A constructor is autowired only when no member is passed as argument. When a member is passed as argument, it will be called with a list of references (where args are identified by their type FQN) in case when member is a function, or it will set the member to the value that is located in container by it's type FQN. Note: In case of constructors as well as methods that are overloaded, the first constructor or method from overload set is selected to be autowired.

  1. auto autowire(Z factory)
    autowire
    (
    Z : InstanceFactoryAware!T
    T
    )
    if (
    getMembersWithProtection!(T, "__ctor", "public").length > 0
    )
  2. auto autowire(Z factory)
  3. auto autowire(Z factory)

Parameters

T

the component type

factory Z

ConfigurationContextFactory where to inject the constructor or method configurer

Return Value

Type: auto

Z

Meta