com.anthonyeden.lib.util
Class CustomClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended bycom.anthonyeden.lib.util.CustomClassLoader

public class CustomClassLoader
extends java.lang.ClassLoader


Constructor Summary
CustomClassLoader(java.io.File searchDirectory)
          Construct a new CustomClassLoader which searches for classes in the given directory.
CustomClassLoader(java.io.File searchDirectory, java.lang.ClassLoader parent)
          Construct a new CustomClassLoader which searches for classes in the parent ClassLoader first and then in the given directory.
CustomClassLoader(java.lang.String searchDirectory)
          Construct a new CustomClassLoader which searches for classes in the given directory.
CustomClassLoader(java.lang.String searchDirectory, java.lang.ClassLoader parent)
          Construct a new CustomClassLoader which searches for classes in the parent ClassLoader first and then in the given directory.
 
Method Summary
 java.lang.Class findClass(java.lang.String name)
          Find the class with the given class name.
 java.net.URL findResource(java.lang.String name)
          Find the resource URL with the given name.
 java.io.File getSearchDirectory()
          Get the directory which is searched for class files.
 void setSearchDirectory(java.io.File searchDirectory)
          Set the directory which is searched for class files.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, 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

CustomClassLoader

public CustomClassLoader(java.lang.String searchDirectory)
Construct a new CustomClassLoader which searches for classes in the given directory.

Parameters:
searchDirectory - The root directory where classes may be found

CustomClassLoader

public CustomClassLoader(java.lang.String searchDirectory,
                         java.lang.ClassLoader parent)
Construct a new CustomClassLoader which searches for classes in the parent ClassLoader first and then in the given directory.

Parameters:
searchDirectory - The root directory where classes may be found
parent - The parent ClassLoader

CustomClassLoader

public CustomClassLoader(java.io.File searchDirectory)
Construct a new CustomClassLoader which searches for classes in the given directory.

Parameters:
searchDirectory - The root directory where classes may be found

CustomClassLoader

public CustomClassLoader(java.io.File searchDirectory,
                         java.lang.ClassLoader parent)
Construct a new CustomClassLoader which searches for classes in the parent ClassLoader first and then in the given directory.

Parameters:
searchDirectory - The root directory where classes may be found
parent - The parent ClassLoader
Method Detail

getSearchDirectory

public java.io.File getSearchDirectory()
Get the directory which is searched for class files.

Returns:
The search directory

setSearchDirectory

public void setSearchDirectory(java.io.File searchDirectory)
Set the directory which is searched for class files.

Parameters:
searchDirectory - The new search directory

findClass

public java.lang.Class findClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Find the class with the given class name.

Parameters:
name - The class name
Returns:
the Class object
Throws:
java.lang.ClassNotFoundException

findResource

public java.net.URL findResource(java.lang.String name)
Find the resource URL with the given name. If the resource URL cannot be found then this method returns null.

Parameters:
name - The resource name
Returns:
The URL


Copyright (c) 2000-2003 Anthony Eden. All Rights Reserved.