public final class ClassUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_MESSAGE_KEY_CLASS_INSTANCE_ERROR |
static String |
EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR |
static String |
EXCEPTION_MESSAGE_KEY_CLASS_UNEXPECTED_TYPE |
Modifier and Type | Method and Description |
---|---|
static Object |
instantiateClass(String className,
Class<?> expectedType)
Instantiates a class.
|
public static final String EXCEPTION_MESSAGE_KEY_CLASS_INSTANCE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR
public static final String EXCEPTION_MESSAGE_KEY_CLASS_UNEXPECTED_TYPE
public static final Object instantiateClass(String className, Class<?> expectedType)
The class is expected to have a public no-argument constructor.
className
- the class nameexpectedType
- the expected (super) type of the resultJRRuntimeException
- if the class cannot be loaded or instantiated,
or if it does not implement the expected typeCopyright © 2017. All rights reserved.