Package net.sf.jasperreports.engine.util
Class ClassUtils
java.lang.Object
net.sf.jasperreports.engine.util.ClassUtils
Class utilities.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetInterfaces
(Class<?> clazz) static final Object
instantiateClass
(String className, Class<?> expectedType) Instantiates a class.
-
Field Details
-
EXCEPTION_MESSAGE_KEY_CLASS_INSTANCE_ERROR
- See Also:
-
EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR
- See Also:
-
EXCEPTION_MESSAGE_KEY_CLASS_UNEXPECTED_TYPE
- See Also:
-
-
Method Details
-
instantiateClass
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
-
getInterfaces
- Parameters:
clazz
-- Returns:
- a list of interfaces implemented by this class and by its superclasses, or an empty list in case there are no implemented interfaces
-