|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
danbikel.util.JarClassLoader
public class JarClassLoader
A class loader for loading a jar file from any URL. Modified from a version taken from Sun's Java website (The JarClassLoader Class).
| Constructor Summary | |
|---|---|
JarClassLoader(URL url)
Creates a new JarClassLoader for the specified URL. |
|
JarClassLoader(URL url,
ClassLoader parent)
Creates a new JarClassLoader for the specified URL and parent class loader. |
|
| Method Summary | |
|---|---|
String |
getMainClassName()
Returns the name of the jar file main class, or null if no "Main-Class" manifest attributes was defined. |
void |
invokeClass(String name,
String[] args)
Invokes the application in this jar file given the name of the main class and an array of arguments. |
| Methods inherited from class java.net.URLClassLoader |
|---|
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
| Methods inherited from class java.security.SecureClassLoader |
|---|
defineClass, defineClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JarClassLoader(URL url)
url - the url of the jar file
public JarClassLoader(URL url,
ClassLoader parent)
url - the url of the jar fileparent - the parent class loader for delegation| Method Detail |
|---|
public String getMainClassName()
throws IOException
IOException
public void invokeClass(String name,
String[] args)
throws ClassNotFoundException,
NoSuchMethodException,
InvocationTargetException
name - the name of the main classargs - the arguments for the application
ClassNotFoundException - if the specified class could not
be found
NoSuchMethodException - if the specified class does not
contain a "main" method
InvocationTargetException - if the application raised an
exception
|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||