public abstract class ClassLoader extends Object
The only method you should override is loadClass(String name,boolean resolve) This method should do the following:
An easier class loader to extend is ewe.util.mClassLoader. This does most of this work already and you only need to override findClassBytes().
Modifier | Constructor and Description |
---|---|
protected |
ClassLoader() |
Modifier and Type | Method and Description |
---|---|
protected Class |
defineClass(String name,
byte[] classBytes,
int start,
int offset)
This tells the VM to convert a sequence of bytes representing a class definition into a Class Object.
|
URL |
getResource(String name) |
InputStream |
getResourceAsStream(String resourceName) |
Enumeration |
getResources(String resourceName) |
static ClassLoader |
getSystemClassLoader()
Return a non-null ClassLoader to represent the system ClassLoader.
|
static URL |
getSystemResource(String name) |
static InputStream |
getSystemResourceAsStream(String resourceName) |
static Enumeration |
getSystemResources(String resourceName) |
Class |
loadClass(String name)
This requests a class to be loaded and resolved.
|
protected abstract Class |
loadClass(String name,
boolean resolve)
This should be overriden to actually locate the class bytes and define the class.
|
protected void |
resolveClass(Class c)
This requests the VM to resolve the class after being defined.
|
public final Class loadClass(String name) throws ClassNotFoundException
ClassNotFoundException
protected abstract Class loadClass(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
protected final void resolveClass(Class c)
protected final Class defineClass(String name, byte[] classBytes, int start, int offset)
public static ClassLoader getSystemClassLoader()
public InputStream getResourceAsStream(String resourceName)
public Enumeration getResources(String resourceName)
public static InputStream getSystemResourceAsStream(String resourceName)
public static Enumeration getSystemResources(String resourceName)