Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

AbstractAutowireCapableObjectFactory.AutowireConstructor Method

"autowire constructor" (with constructor arguments by type) behaviour.

[Visual Basic]
Protected Sub AutowireConstructor( _
   ByVal name As String, _
   ByVal definition As RootObjectDefinition, _
   ByVal ctors As ConstructorInfo, _
   ByVal explicitArgs As Object _
)
[C#]
protected IObjectWrapper AutowireConstructor(
   string name,
   RootObjectDefinition definition,
   ConstructorInfo[] ctors,
   object[] explicitArgs
);

Parameters

name
The name of the object to autowire by type.
definition
The object definition to update through autowiring.
ctors
The chosen candidate constructors.
explicitArgs
The argument values passed in programmatically via the GetObject method, or
null
if none (-> use constructor argument values from object definition)

Return Value

An IObjectWrapper for the new instance.

Remarks

Also applied if explicit constructor argument values are specified, matching all remaining arguments with objects from the object factory.

This corresponds to constructor injection: in this mode, a Spring.NET object factory is able to host components that expect constructor-based dependency resolution.

See Also

AbstractAutowireCapableObjectFactory Class | Spring.Objects.Factory.Support Namespace