OptionConverter InstantiateByClassName Method Apache log4net™ SDK Documentation
Instantiates an object given a class name.

Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 1.2.15.0 (1.2.15.0)
Syntax

public static Object InstantiateByClassName(
	string className,
	Type superClass,
	Object defaultValue
)

Parameters

className
Type: OnlineSystem String
The fully qualified class name of the object to instantiate.
superClass
Type: OnlineSystem Type
The class to which the new object should belong.
defaultValue
Type: OnlineSystem Object
The object to return in case of non-fulfillment.

Return Value

Type: OnlineObject
An instance of the className or defaultValue if the object could not be instantiated.
Remarks

Checks that the className is a subclass of superClass. If that test fails or the object could not be instantiated, then defaultValue is returned.

See Also