|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.ClassLoader
|
+--koala.dynamicjava.interpreter.TreeClassLoader
This class is responsible for loading bytecode classes
| Field Summary | |
protected java.util.Map |
classes
The place where the interpreted classes are stored |
protected java.lang.ClassLoader |
classLoader
The auxiliary class loader |
protected Interpreter |
interpreter
The interpreter |
protected java.util.Map |
trees
The syntax trees |
| Constructor Summary | |
TreeClassLoader(Interpreter i)
Creates a new class loader |
|
| Method Summary | |
void |
addTree(java.lang.String name,
TypeDeclaration node)
Adds a class syntax tree to the list of the loaded trees |
void |
addURL(java.net.URL url)
Adds an URL in the class path |
java.lang.Class |
defineClass(java.lang.String name,
byte[] code)
Converts an array of bytes into an instance of class Class and links this class. |
protected java.lang.Class |
findClass(java.lang.String name)
Finds the specified class. |
java.lang.ClassLoader |
getClassLoader()
Returns the additional class loader that is used for loading classes from the net. |
java.util.Set |
getClassNames()
Returns the names of the defined classes in a set |
TypeDeclaration |
getTree(java.lang.String name)
Gets a tree |
boolean |
hasDefined(java.lang.String name)
Whether a class was defined by this class loader |
| Methods inherited from class java.lang.ClassLoader |
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Map classes
protected java.util.Map trees
protected Interpreter interpreter
protected java.lang.ClassLoader classLoader
| Constructor Detail |
public TreeClassLoader(Interpreter i)
i - the object used to interpret the classes| Method Detail |
public java.lang.Class defineClass(java.lang.String name,
byte[] code)
java.lang.ClassFormatError - if the class could not be definedpublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface ClassLoaderContainerpublic boolean hasDefined(java.lang.String name)
public java.util.Set getClassNames()
public void addTree(java.lang.String name,
TypeDeclaration node)
name - the name of the typenode - the treepublic TypeDeclaration getTree(java.lang.String name)
public void addURL(java.net.URL url)
protected java.lang.Class findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in class java.lang.ClassLoadername - the name of the classClass objectjava.lang.ClassNotFoundException - if the class could not be find
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||