|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.libxjava.lang.SimpleClassLoader
public class SimpleClassLoader
| Constructor Summary | |
|---|---|
SimpleClassLoader()
|
|
| Method Summary | |
|---|---|
InputStream |
getResourceAsStream(String name)
Finds a resource with the given name in the classpath of this classloader. |
Class |
loadClass(String name)
Returns the Class object associated with the class with the
given name. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleClassLoader()
| Method Detail |
|---|
public InputStream getResourceAsStream(String name)
IClassLoadernull if no resource with this name is found.
The resource names can be represented in two different formats: absolute or relative.
Absolute format:
/packagePathName/resourceNameRelative format:
resourceNameIn the absolute format, the programmer provides a fully qualified name that includes both the full path and the name of the resource inside the classpath. In the path names, the character "/" is used as the separator.
In the relative format, the programmer provides only the name of the actual resource.
Relative names are converted to absolute names by the system by prefixing the
resource name with the fully qualified package name of class upon which the
getResourceAsStream method was called.
getResourceAsStream in interface IClassLoadername - name of the desired resource
java.io.InputStream object
public Class loadClass(String name)
throws ClassNotFoundException
IClassLoaderClass object associated with the class with the
given name. The classpath currently associated with this classloader
will be searched.
- Specified by:
loadClass in interface IClassLoader
- Parameters:
name - the fully qualified name of the desired class
- Returns:
- the
Class object for the class with the specified name
- Throws:
ClassNotFoundException - if the class could not be found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||