public final class ClassLoaders extends Object
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
loadClass(String className,
ClassLoader classLoader,
Object caller)
Loads the class with the given class name with the given classloader.
|
static ClassLoader |
setContextClassLoader(ClassLoader classLoader)
Sets the context ClassLoader and returns the current ClassLoader.
|
public static Class<?> loadClass(String className, @Nullable ClassLoader classLoader, Object caller) throws ClassNotFoundException
null,
load the class with the ClassLoader of the caller object.className - Name of the class to load.classLoader - Classloader for loading the class. It could be null.caller - The object who call this method.ClassNotFoundException - If failed to load the given class.public static ClassLoader setContextClassLoader(ClassLoader classLoader)
Copyright © 2019 CDAP Licensed under the Apache License, Version 2.0.