openjava.ojc
Class DynamicJavaCompiler
java.lang.Object
|
+--openjava.ojc.DynamicJavaCompiler
- All Implemented Interfaces:
- JavaCompiler
- public class DynamicJavaCompiler
- extends Object
- implements JavaCompiler
DynamicJavaCompiler implements the JavaCompiler
interface by calling DynamicJava.
DynamicJava runs faster than a regular java compiler, does not
necessarily generate temporary files, and can run inside a sandbox. But
there are a few issues:
- The classes are only accessible via DynamicJava's class loader
(
getClassLoader()).
- There seems to be a bug with access to methods in anonymous classes,
for example, the
public modifier should not be required
here:
int x = new Object() {
public int five() { return 5; }
}.foo();
- Problem with fully-qualified names of inner classes. It prefers
pakkage.Outer$Inner to pakkage.Outer.Inner.
Version. To build and run this class, you will need to download
DynamicJava 1.1.4 or later and include
${djava.home}/lib/dynamicjava.jar on your class path.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
args
private DynamicJavaCompiler.DynamicJavaCompilerArgs args
interpreter
private TreeInterpreter interpreter
DynamicJavaCompiler
public DynamicJavaCompiler()
getArgs
public JavaCompilerArgs getArgs()
- Specified by:
getArgs in interface JavaCompiler
compile
public void compile()
- Specified by:
compile in interface JavaCompiler
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader in interface JavaCompiler