com.github.libxjava.lang
Interface IClassLoader

All Known Implementing Classes:
SimpleClassLoader

public interface IClassLoader

Class loading interface for platforms with no java.lang.ClassLoader. Classloaders are mainly used in the deserialisers.

Version:
libxjava-jse5 - 0.2
Author:
Marcel Patzlaff

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.
 

Method Detail

loadClass

Class loadClass(String name)
                throws ClassNotFoundException
Returns the Class object associated with the class with the given name. The classpath currently associated with this classloader will be searched.

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
Error - if the function fails for any other reason

getResourceAsStream

InputStream getResourceAsStream(String name)
Finds a resource with the given name in the classpath of this classloader. This method returns null if no resource with this name is found.

The resource names can be represented in two different formats: absolute or relative.

Absolute format:

    /packagePathName/resourceName

Relative format:

    resourceName

In 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.

Parameters:
name - name of the desired resource
Returns:
a java.io.InputStream object


Copyright © 2010 Marcel Patzlaff. All Rights Reserved.