|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.ClassLoader | +--net.janino.ByteArrayClassLoader
This ClassLoader
allows for the loading of JavaTM classes
from a byte array, an java.io.InputStream
or a java.io.File
.
Constructor Summary | |
ByteArrayClassLoader()
|
|
ByteArrayClassLoader(java.lang.ClassLoader parent)
|
Method Summary | |
void |
addClass(java.lang.String name,
byte[] data)
Adds a class that will be found by findClass(String) . |
void |
addClass(java.lang.String name,
java.io.File file)
Adds a class that will be found by findClass(String) . |
void |
addClass(java.lang.String name,
java.io.InputStream inputStream)
Adds a class that will be found by findClass(String) . |
protected java.lang.Class |
findClass(java.lang.String name)
Implements java.lang.ClassLoader.findClass(String) . |
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 |
Constructor Detail |
public ByteArrayClassLoader()
public ByteArrayClassLoader(java.lang.ClassLoader parent)
Method Detail |
public void addClass(java.lang.String name, byte[] data)
findClass(String)
.name
- the name of the classdata
- the data of the class in "class file format"public void addClass(java.lang.String name, java.io.InputStream inputStream) throws java.io.IOException
findClass(String)
.name
- the name of the classinputStream
- source of data of the class in "class file format"java.io.IOException
- Problems reading from the inputStream
public void addClass(java.lang.String name, java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
findClass(String)
.name
- the name of the classfile
- the file that contains the data of the class in "class file format"java.io.FileNotFoundException
- The file does not existjava.io.IOException
- Problems reading the class fileprotected java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException
java.lang.ClassLoader.findClass(String)
.findClass
in class java.lang.ClassLoader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |