public final class ClassUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
classNameToInternalClassName(String className)
Will convert a class name to its name in the class definition format (e.g
org.objenesis.EmptyClass
becomes org/objenesis/EmptyClass ) |
static String |
classNameToResource(String className)
Will convert a class name to its class loader resource name (e.g
org.objenesis.EmptyClass
becomes org/objenesis/EmptyClass.class ) |
static <T> Class<T> |
getExistingClass(ClassLoader classLoader,
String className)
Check if this class already exists in the class loader and return it if it does
|
static <T> T |
newInstance(Class<T> clazz) |
public static String classNameToInternalClassName(String className)
org.objenesis.EmptyClass
becomes org/objenesis/EmptyClass
)className
- full class name including the packagepublic static String classNameToResource(String className)
org.objenesis.EmptyClass
becomes org/objenesis/EmptyClass.class
)className
- full class name including the packagepublic static <T> Class<T> getExistingClass(ClassLoader classLoader, String className)
T
- type of the class returnedclassLoader
- Class loader where to search the classclassName
- Class name with full pathpublic static <T> T newInstance(Class<T> clazz)
Copyright © 2006–2024 Joe Walnes, Henri Tremblay, Leonardo Mesquita. All rights reserved.