|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.ClassLoader | +--MAEPlugin.FileClassLoader
Class to dynamic classes from local disks. This allows plugins to be loaded.
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.
ClassLoader
Constructor Summary | |
FileClassLoader(java.io.File file)
FileClassLoader() - Constructor to load .classfile. |
|
FileClassLoader(java.lang.String path)
FileClassLoader() - Constructor to load path. |
Method Summary | |
java.lang.Class |
findFileClass(java.lang.String name)
findFileClass() - find file of class by name. |
java.net.URL |
getResource(java.lang.String name)
getResource() - Returns a URL containing the location of the named resource. |
java.io.InputStream |
getResourceAsStream(java.lang.String name)
getResourceAsStream() - returns an input stream to the named source. |
java.lang.Class |
loadClass(java.io.File file)
loadClass() - Implementation of ClassLoader.loadClass() by name of File pointer. |
protected java.lang.Class |
loadClass(java.io.File file,
boolean resolve)
* loadClass() - Implementation of ClassLoader.loadClass() by name of File pointer and user option to resolve. |
java.lang.Class |
loadClass(java.lang.String name)
loadClass() - Implementation of ClassLoader.loadClass() by name of class. |
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
loadClass() - Implementation of ClassLoader.loadClass() From javadoc v. |
protected java.lang.Class |
loadClassFromZip(java.lang.String zipPath,
java.lang.String className)
loadClassFromZip() - loads classes and resources of a zip or jar file and loads the one class that has the same name as the archive. |
Methods inherited from class java.lang.ClassLoader |
defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setSigners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileClassLoader(java.lang.String path)
path
- class to be loadedpublic FileClassLoader(java.io.File file)
File
- itself, directory, class file or jar archive of class to be loadedMethod Detail |
protected java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
findLoadedClass(String)
to check if class
hasalready been loaded.
loadClass
method on the parent class
loader. If the parent is null
the class loader
built-in to the virtual machine is used, instead.
findClass(String)
method to find class.
resolve
flag is true, this method will then call the
resolveClass(Class)
method on the resulting class object.
From the Java 2 SDK, v1.2, subclasses of ClassLoader are
encouraged to override
findClass(String)
, rather than this method.
name
- the name of the class
resolve
- if true
then resolve class
Class
object
ClassNotFoundException
- if class couldn't be found
loadClass
in class java.lang.ClassLoader
className
- name of the class to loadresolve
- called by Classloader savvy code to force resolution
of the class.java.lang.ClassNotFoundException
- thrown whenever class can not be loaded.public java.lang.Class loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
className
- Name of the class to load
equivalent of loadClass(name, false);java.lang.ClassNotFoundException
- Thrown whenever class can't be loaded.public java.lang.Class loadClass(java.io.File file) throws java.lang.ClassNotFoundException
file
- file to be loadedprotected java.lang.Class loadClass(java.io.File file, boolean resolve) throws java.lang.ClassNotFoundException
file
- file to be loadedresolve
- try to resolve classes if truepublic java.lang.Class findFileClass(java.lang.String name) throws java.lang.ClassNotFoundException
name
- Name of the Classjava.lang.ClassNotFoundException
- If any error occurs,
a ClassNotFoundException is thrown.public java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
name
- Name of the resourcepublic java.io.InputStream getResourceAsStream(java.lang.String name)
getResourceAsStream
in class java.lang.ClassLoader
name
- Name of the resourceprotected java.lang.Class loadClassFromZip(java.lang.String zipPath, java.lang.String className)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |