Class ReflectionUtils

java.lang.Object
cz.cvut.kbss.jopa.utils.ReflectionUtils

public class ReflectionUtils extends Object
Utility functions using Java Reflection API.
  • Method Details

    • instantiateUsingDefaultConstructor

      public static <T> T instantiateUsingDefaultConstructor(Class<T> cls)
      Creates a new instance of the specified class using the default no-arg constructor.

      Note that it is expected that the no-arg constructor exists and is publicly accessible.

      Type Parameters:
      T - Type
      Parameters:
      cls - Class to instantiate
      Returns:
      New instance of class cls
      Throws:
      InstantiationException - When no-arg constructor does not exist or is not accessible