Package com.linkedin.venice.utils
Class ReflectUtils
java.lang.Object
com.linkedin.venice.utils.ReflectUtils
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
callConstructor
(Class<T> c, Class<?>[] argTypes, Object[] args) Call the class constructor with the given argumentsstatic <T> Class<T>
Load the given class using the default constructorstatic void
Print to the logs the entire classpath (one line per jar)static void
Given an exception about a class that doesn't have the expected API, print to the logs which jar is that class coming from.
-
Constructor Details
-
ReflectUtils
public ReflectUtils()
-
-
Method Details
-
loadClass
Load the given class using the default constructor- Parameters:
className
- The name of the class- Returns:
- The class object
-
callConstructor
Call the class constructor with the given arguments- Type Parameters:
T
- Type of the class- Parameters:
c
- The classargTypes
- The type of each argumentargs
- The arguments- Returns:
- The constructed object
-
printClasspath
public static void printClasspath()Print to the logs the entire classpath (one line per jar) -
printJarContainingBadClass
Given an exception about a class that doesn't have the expected API, print to the logs which jar is that class coming from.
-