edu.rice.cs.plt.reflect
Class AbstractClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by edu.rice.cs.plt.reflect.AbstractClassLoader
Direct Known Subclasses:
PathClassLoader, PreemptingClassLoader

public abstract class AbstractClassLoader
extends ClassLoader

A class loader that provides a helper method definePackageForClass.


Constructor Summary
protected AbstractClassLoader()
          Creates a new class loader using the ClassLoader returned by the method getSystemClassLoader() as the parent class loader.
protected AbstractClassLoader(ClassLoader parent)
          Creates a new class loader using the specified parent class loader for delegation.
 
Method Summary
protected  Package definePackageForClass(String className)
          Defines a package for a class, unless it has been defined already.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractClassLoader

protected AbstractClassLoader()
Creates a new class loader using the ClassLoader returned by the method getSystemClassLoader() as the parent class loader.

If there is a security manager, its checkCreateClassLoader method is invoked. This may result in a security exception.

Throws:
SecurityException - If a security manager exists and its checkCreateClassLoader method doesn't allow creation of a new class loader.

AbstractClassLoader

protected AbstractClassLoader(ClassLoader parent)
Creates a new class loader using the specified parent class loader for delegation.

If there is a security manager, its checkCreateClassLoader method is invoked. This may result in a security exception.

Parameters:
parent - The parent class loader
Throws:
SecurityException - If a security manager exists and its checkCreateClassLoader method doesn't allow creation of a new class loader.
Since:
1.2
Method Detail

definePackageForClass

protected Package definePackageForClass(String className)
Defines a package for a class, unless it has been defined already. This must be done before the class is defined.

Parameters:
className - the name of the class that is being loaded