ca.spaz.util
Class Loader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by ca.spaz.util.Loader

public final class Loader
extends java.lang.ClassLoader

A special class for loading classes from an jar file.

Author:
Aaron Davidson

Constructor Summary
Loader(java.io.File file)
           
 
Method Summary
protected  java.lang.Class loadClass(java.lang.String name, boolean resolve)
          Load a class by name.
 javax.swing.ImageIcon loadImageIcon(java.lang.String name)
           
 java.lang.Object newInstance(java.lang.String name)
          Create a new instance of a class in this jar file.
 
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, 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

Loader

public Loader(java.io.File file)
Method Detail

newInstance

public java.lang.Object newInstance(java.lang.String name)
Create a new instance of a class in this jar file. Must have a basic constructor with no arguments.

Parameters:
name - the class name to instantiate
Returns:
an Object created from the given class

loadClass

protected java.lang.Class loadClass(java.lang.String name,
                                    boolean resolve)
                             throws java.lang.ClassNotFoundException
Load a class by name.

Overrides:
loadClass in class java.lang.ClassLoader
Throws:
java.lang.ClassNotFoundException
See Also:
java.lang.ClassLoader#loadClass()

loadImageIcon

public javax.swing.ImageIcon loadImageIcon(java.lang.String name)


Copyright © 2005 Spaz. All Rights Reserved.