Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

StaticListableObjectFactory.GetObject(String, Type, Object) Method

Return an instance (possibly shared or independent) of the given object name.

[Visual Basic]
Public NotOverridable Overloads Sub GetObject( _
   ByVal name As String, _
   ByVal requiredType As Type, _
   ByVal arguments As Object _
) _
    Implements IObjectFactory.GetObject
[C#]
public object GetObject(
   string name,
   Type requiredType,
   object[] arguments
);

Parameters

name
The name of the object to return.
requiredType
The Type the object may match. Can be an interface or superclass of the actual class. For example, if the value is the Object class, this method will succeed whatever the class of the returned instance.
arguments
The arguments to use if creating a prototype using explicit arguments to a factory method. If there is no factory method and the supplied arguments array is not , then match the argument values by type and call the object's constructor.

Return Value

The instance of the object.

Implements

IObjectFactory.GetObject

Exceptions

Exception Type Condition
NoSuchObjectDefinitionException If there's no such object definition.
ObjectsException If the object could not be created.
ObjectNotOfRequiredTypeException If the object is not of the required type.
ArgumentNullException If the supplied name is a null reference (Nothing in Visual Basic).

See Also

StaticListableObjectFactory Class | Spring.Objects.Factory.Support Namespace | StaticListableObjectFactory.GetObject Overload List | GetObject