Class ReflectUtils

java.lang.Object
com.linkedin.venice.utils.ReflectUtils

public class ReflectUtils extends Object
Utilities for reflection TODO This class may not be needed if we decide to proceed with Guice library for reflections and need to be discarded then
  • Constructor Details

    • ReflectUtils

      public ReflectUtils()
  • Method Details

    • loadClass

      public static <T> Class<T> loadClass(String className)
      Load the given class using the default constructor
      Parameters:
      className - The name of the class
      Returns:
      The class object
    • callConstructor

      public static <T> T callConstructor(Class<T> c, Class<?>[] argTypes, Object[] args)
      Call the class constructor with the given arguments
      Type Parameters:
      T - Type of the class
      Parameters:
      c - The class
      argTypes - The type of each argument
      args - The arguments
      Returns:
      The constructed object
    • printClasspath

      public static void printClasspath()
      Print to the logs the entire classpath (one line per jar)
    • printJarContainingBadClass

      public static void printJarContainingBadClass(NoSuchMethodError e)
      Given an exception about a class that doesn't have the expected API, print to the logs which jar is that class coming from.