|
Web Site | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
org.codehaus.janino.JavaSourceClassLoader
A ClassLoader
that, unlike usual ClassLoader
s,
does not load byte code, but reads JavaTM source code and then scans, parses,
compiles and loads it into the virtual machine.
Nested Class Summary | |
static interface |
JavaSourceClassLoader.ProtectionDomainFactory
|
Constructor Summary | |
JavaSourceClassLoader(ClassLoader parentClassLoader,
File[] optionalSourcePath,
String optionalCharacterEncoding,
DebuggingInformation debuggingInformation)
Set up a JavaSourceClassLoader that finds JavaTM source code in a file
that resides in either of the directories specified by the given source path. |
|
JavaSourceClassLoader(ClassLoader parentClassLoader,
ResourceFinder sourceFinder,
String optionalCharacterEncoding,
DebuggingInformation debuggingInformation)
Set up a JavaSourceClassLoader that finds JavaTM source code through
a given ResourceFinder . |
Method Summary | |
protected Class |
findClass(String name)
Implementation of ClassLoader.findClass(String) . |
static void |
main(String[] args)
Read JavaTM source code for a given class name, scan, parse, compile and load it into the virtual machine, and invoke its "main()" method. |
void |
setProtectionDomainFactory(JavaSourceClassLoader.ProtectionDomainFactory protectionDomainFactory)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JavaSourceClassLoader(ClassLoader parentClassLoader, File[] optionalSourcePath, String optionalCharacterEncoding, DebuggingInformation debuggingInformation)
JavaSourceClassLoader
that finds JavaTM source code in a file
that resides in either of the directories specified by the given source path.
parentClassLoader
- See ClassLoader
optionalSourcePath
- A collection of directories that are searched for JavaTM source files in the given orderoptionalCharacterEncoding
- The encoding of the JavaTM source files (null
for platform default encoding)debuggingInformation
- What kind of debugging information to generatepublic JavaSourceClassLoader(ClassLoader parentClassLoader, ResourceFinder sourceFinder, String optionalCharacterEncoding, DebuggingInformation debuggingInformation)
JavaSourceClassLoader
that finds JavaTM source code through
a given ResourceFinder
.
parentClassLoader
- See ClassLoader
sourceFinder
- Used to locate additional source filesoptionalCharacterEncoding
- The encoding of the JavaTM source files (null
for platform default encoding)debuggingInformation
- What kind of debugging information to generateMethod Detail |
public static void main(String[] args)
Usage is as follows:
java [ java-option ] org.codehaus.janino.JavaSourceClassLoader [ option ] ... class-name [ arg ] ... java-option Any valid option for the Java Virtual Machine (e.g. "-classpath colon-separated-list-of-class-directories") option: -sourcepath colon-separated-list-of-source-directories -encoding character-encoding
protected Class findClass(String name) throws ClassNotFoundException
ClassLoader.findClass(String)
.
ClassNotFoundException
TunnelException
- wraps a Scanner.ScanException
TunnelException
- wraps a Parser.ParseException
TunnelException
- wraps a CompileException
TunnelException
- wraps a IOException
public void setProtectionDomainFactory(JavaSourceClassLoader.ProtectionDomainFactory protectionDomainFactory)
|
Web Site | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |