public class ClassLoaderCreator extends Object
ClassLoader instance that dynamically loads classes from jar files.| 构造器 | 说明 |
|---|---|
ClassLoaderCreator() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static ClassLoader |
createClassLoader(String jarPaths,
ClassLoader parent) |
Creates a
ClassLoader instance that loads classes from jar files in different paths. |
static ClassLoader |
createClassLoader(String jarPaths,
String nativeLibraryDirs,
ClassLoader parent) |
Creates a
ClassLoader instance that loads classes from jar files
and loads native libraries in different paths. |
static ClassLoader |
createClassLoader(String jarPaths,
String nativeLibraryDirs,
ClassLoader parent,
boolean isDelegateParentLast) |
Creates a
ClassLoader instance that loads classes from jar files
and loads native libraries in different paths. |
public static ClassLoader createClassLoader(String jarPaths, ClassLoader parent)
ClassLoader instance that loads classes from jar files in different paths.jarPaths - Indicates the path of jar files from which classes are loaded. Separate jarPaths
with File.pathSeparator if jar files are located in different paths.parent - Indicates the parent class loader of the newly created class loader.ClassLoader object.public static ClassLoader createClassLoader(String jarPaths, String nativeLibraryDirs, ClassLoader parent)
ClassLoader instance that loads classes from jar files
and loads native libraries in different paths.jarPaths - Indicates the path of jar files from which classes are loaded. Separate jarPaths
with File.pathSeparator if jar files are located in different paths.nativeLibraryDirs - Indicates the path of native libraries to be loaded. Separate nativeLibraryDirs
with File.pathSeparator if native libraries are located in different paths.parent - Indicates the parent class loader of the newly created class loader.ClassLoader object.public static ClassLoader createClassLoader(String jarPaths, String nativeLibraryDirs, ClassLoader parent, boolean isDelegateParentLast)
ClassLoader instance that loads classes from jar files
and loads native libraries in different paths.jarPaths - Indicates the path of jar files from which classes are loaded. Separate jarPaths
with File.pathSeparator if jar files are located in different paths.nativeLibraryDirs - Indicates the path of native libraries to be loaded. Separate nativeLibraryDirs
with File.pathSeparator if native libraries are located in different paths.parent - Indicates the parent class loader of the newly created class loader.isDelegateParentLast - Specifies whether jarPaths takes preference over the delegated parent
classloader. Value true indicates that jarPaths is preferred over the delegated parent
classloader, and false means the opposite. Note that bootclasspath is always top-preferred.