Class ClassUtils

java.lang.Object
org.luwrain.util.ClassUtils

public final class ClassUtils extends Object
  • 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 use
      className - The name of the class to create instance of
      ensureInstanceOf - The class object of the class to check the casting is possible (can be null what means to checking is required)
      Returns:
      The created object or null, if something goes wrong (detailed information goes only to the log)