Skip to content

ExtensionClassLoader ​

com.jsmacrosce.jsmacros.core.extensions.ExtensionClassLoader

Loads classes from an initial URL search path and allows URLs to be appended.
Its parent is the class loader that defined ExtensionClassLoader;
class loading otherwise follows the inherited parent-first delegation model.

js
const Loader = Java.type("com.jsmacrosce.jsmacros.core.extensions.ExtensionClassLoader");  
const urls = Java.to([], "java.net.URL[]");  
const loader = new Loader(urls);  
try {
 loader.loadClass("java.lang.String");  
} finally {
 loader.close();  
}

Constructors ​

new ExtensionClassLoader ​

new ExtensionClassLoader(URL[] urls)#
Sets the initial URL search path and uses the loader that defined this class as parent.

Parameters:

  • urls: initial URLs; the array must not be null, but may be empty

Methods ​

addURL ​

addURL(URL url): void#
Appends a URL to this loader's search path. A null URL, a duplicate URL, or an addition after the loader is closed is ignored.

Parameters:

  • url: URL to append; null is ignored