Package org.apache.openjpa.lib.util
Class ClassUtil
- java.lang.Object
 - 
- org.apache.openjpa.lib.util.ClassUtil
 
 
- 
public final class ClassUtil extends Object
Various helper methods to deal with Classes 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
- 
toClass
public static Class toClass(String str, ClassLoader loader)
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
public static Class toClass(String str, boolean resolve, ClassLoader loader)
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
public static String getClassName(Class cls)
Return only the class name, without package. 
- 
getPackageName
public static String getPackageName(Class cls)
Return only the package, or empty string if none. 
 - 
 
 -