Package net.sf.jasperreports.engine.util
Class ClassUtils
- java.lang.Object
-
- net.sf.jasperreports.engine.util.ClassUtils
-
public final class ClassUtils extends Object
Class utilities.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field 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
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Class<?>>
getInterfaces(Class<?> clazz)
static Object
instantiateClass(String className, Class<?> expectedType)
Instantiates a class.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_CLASS_INSTANCE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_CLASS_INSTANCE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR
public static final String EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CLASS_UNEXPECTED_TYPE
public static final String EXCEPTION_MESSAGE_KEY_CLASS_UNEXPECTED_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
instantiateClass
public static final Object instantiateClass(String className, Class<?> expectedType)
Instantiates a class.The class is expected to have a public no-argument constructor.
- Parameters:
className
- the class nameexpectedType
- the expected (super) type of the result- Returns:
- a newly created instance of the specified class
- Throws:
JRRuntimeException
- if the class cannot be loaded or instantiated, or if it does not implement the expected type
-
-