Package cz.cvut.kbss.jopa.utils
Class ReflectionUtils
java.lang.Object
cz.cvut.kbss.jopa.utils.ReflectionUtils
Utility functions using Java Reflection API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Creates a new instance of the specified class using the default no-arg constructor.
-
Method Details
-
instantiateUsingDefaultConstructor
Creates a new instance of the specified class using the default no-arg constructor.Note that it is expected that the no-arg constructor exists and is publicly accessible.
- Type Parameters:
T
- Type- Parameters:
cls
- Class to instantiate- Returns:
- New instance of class
cls
- Throws:
InstantiationException
- When no-arg constructor does not exist or is not accessible
-