Package org.luwrain.util
Class ClassUtils
java.lang.Object
org.luwrain.util.ClassUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
newInstanceOf
(ClassLoader classLoader, String className, Class ensureInstanceOf) Creates new instance of the requested class and ensures that it can be safely assigned to some class or interface.
-
Constructor Details
-
ClassUtils
public ClassUtils()
-
-
Method Details
-
newInstanceOf
public static Object newInstanceOf(ClassLoader classLoader, String className, Class ensureInstanceOf) Creates new instance of the requested class and ensures that it can be safely assigned to some class or interface.- Parameters:
classLoader
- The class loader to useclassName
- The name of the class to create instance ofensureInstanceOf
- The class object of the class to check the casting is possible (can benull
what means to checking is required)- Returns:
- The created object or
null
, if something goes wrong (detailed information goes only to the log)
-