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 StringgetClassName(Class cls) Return only the class name, without package.static StringgetClassName(String fullName) Return only the class name.static StringgetPackageName(Class cls) Return only the package, or empty string if none.static StringgetPackageName(String fullName) Return only the package, or empty string if none.static ClasstoClass(String str, boolean resolve, ClassLoader loader) Return the class for the given string, correctly handling primitive types.static ClasstoClass(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.
-