Package org.apache.openjpa.lib.util
Class ClassUtil
java.lang.Object
org.apache.openjpa.lib.util.ClassUtil
Various helper methods to deal with Classes
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getClassName
(Class cls) Return only the class name, without package.static String
getClassName
(String fullName) Return only the class name.static String
getPackageName
(Class cls) Return only the package, or empty string if none.static String
getPackageName
(String fullName) Return only the package, or empty string if none.static Class
toClass
(String str, boolean resolve, ClassLoader loader) Return the class for the given string, correctly handling primitive types.static Class
toClass
(String str, ClassLoader loader) Return the class for the given string, correctly handling primitive types.
-
Method Details
-
toClass
Return the class for the given string, correctly handling primitive types. If the given class loader is null, the context loader of the current thread will be used.- Throws:
RuntimeException
- on load error
-
toClass
Return the class for the given string, correctly handling primitive types. If the given class loader is null, the context loader of the current thread will be used.- Throws:
RuntimeException
- on load error
-
getClassName
Return only the class name, without package. -
getClassName
Return only the class name. -
getPackageName
Return only the package, or empty string if none. -
getPackageName
Return only the package, or empty string if none.
-