Package org.carrot2.util
Class ReflectionUtils
- java.lang.Object
-
- org.carrot2.util.ReflectionUtils
-
public final class ReflectionUtils extends Object
Utilities related to Java reflection.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>
classForName(String clazzName)
Load and initialize (or return, if already defined) a given class using context class loader.static Class<?>
classForName(String clazzName, boolean logWarning)
Load and initialize (or return, if already defined) a given class using context class loader.
-
-
-
Method Detail
-
classForName
public static Class<?> classForName(String clazzName) throws ClassNotFoundException
Load and initialize (or return, if already defined) a given class using context class loader. If class cannot be found, aClassNotFoundException
is thrown and logged.- Throws:
ClassNotFoundException
-
classForName
public static Class<?> classForName(String clazzName, boolean logWarning) throws ClassNotFoundException
Load and initialize (or return, if already defined) a given class using context class loader.- Parameters:
clazzName
- class name to loadlogWarning
- iftrue
, a warning will be logged if class cannot be found- Throws:
ClassNotFoundException
-
-