Package com.groiss.util
Class ClassUtil
java.lang.Object
com.groiss.util.ClassUtil
Utility for loading classes and creating instances.
Checked exceptions are wrapped into
ApplicationException
. The class loader returned from
Settings.getClassLoader()
is used.-
Method Summary
Modifier and TypeMethodDescriptiongetClasses
(String clazzNames) Load the classes from the given class names.static <T> T
instantiate
(String clazzName) Load a class and create an instance.static <T> List<T>
instantiate
(List<Class<T>> clazzes) Call the default constructor for each element of the given list of classes.
-
Method Details
-
getClasses
Load the classes from the given class names.- Parameters:
clazzNames
- list of class names separated by comma, newline, or carriage return.- Returns:
- class objects
-
instantiate
Load a class and create an instance.- Parameters:
clazzName
- name of a class- Returns:
- instance of given class
-
instantiate
Call the default constructor for each element of the given list of classes.- Parameters:
clazzes
- list of classes- Returns:
- instances of the classes
-