public static <T> T newInstance(java.lang.String className,
This method uses reflection to create a new instance of the class defined
as String. It checks that the configured class matches the type which is
requested. It looks for a static method which is callable with the
specified arguments and uses that to create an instance.
Reflection is rather costly and therefore this method should not be used
Since types and therefore type safety can only be checked at compile time,
this method may fail at runtime for any mistake in configuration.
Primitive types as arguments of the static method are currently not
className - the fully qualified name of the class to load
superClass - the type which the created object should have. The returned
instance is a subclass of this type or implements this
parameters - arguments given to the static create method. It is the users
responsibility to check that there is a constructor with these
arguments in all classes which could be configured to be loaded.
Instantciation fails if there is no constructor which excactly
matches these parameters.
an instance of the class with the given name, which is a subclass
of the class specified as first parameter.