public class ClassUtil extends Object
| Constructor and Description |
|---|
ClassUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
forName(String name)
Load a class taking into account a context class loader (if present).
|
static Class<?> |
forName(String name,
Class<?> caller)
Load a class taking into account a context class loader (if present).
|
static ClassLoader |
getClassLoader(Class<?> caller,
boolean preferContext) |
static boolean |
isPresent(String className)
Return true if the given class is present.
|
static boolean |
isPresent(String className,
Class<?> caller)
Return true if the given class is present.
|
static Object |
newInstance(String className)
Return a new instance of the class using the default constructor.
|
static Object |
newInstance(String className,
Class<?> caller)
Return a new instance of the class using the default constructor.
|
public static Class<?> forName(String name) throws ClassNotFoundException
ClassNotFoundExceptionpublic static Class<?> forName(String name, Class<?> caller) throws ClassNotFoundException
ClassNotFoundExceptionpublic static ClassLoader getClassLoader(Class<?> caller, boolean preferContext)
public static boolean isPresent(String className)
public static boolean isPresent(String className, Class<?> caller)
public static Object newInstance(String className)
Copyright © 2014. All Rights Reserved.