org.apache.commons.jci.compilers
Class JavacJavaCompiler
java.lang.Object
org.apache.commons.jci.compilers.AbstractJavaCompiler
org.apache.commons.jci.compilers.JavacJavaCompiler
- All Implemented Interfaces:
- JavaCompiler
public final class JavacJavaCompiler
- extends AbstractJavaCompiler
Compiler leveraging the javac from tools.jar. Using byte code rewriting
it is tricked not to read/write from/to disk but use the ResourceReader and
ResourceStore provided instead.
NOTE: (As of now) this compiler only works up until java5. Java6 comes with
a new API based on jsr199. So please use that jsr199 compiler instead.
- Author:
- tcurdt
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavacJavaCompiler
public JavacJavaCompiler()
JavacJavaCompiler
public JavacJavaCompiler(JavacJavaCompilerSettings pSettings)
compile
public CompilationResult compile(String[] pSourcePaths,
ResourceReader pReader,
ResourceStore pStore,
ClassLoader pClasspathClassLoader,
JavaCompilerSettings pSettings)
- Description copied from interface:
JavaCompiler
- Compiles the java resources "some/path/to/MyJava.java"
read through the ResourceReader and then stores the resulting
classes in the ResourceStore under "some/path/to/MyJava.class".
Note: As these are resource path you always have to use "/"
The result of the compilation run including detailed error
information is returned as CompilationResult. If you need to
get notified already during the compilation process you can
register a CompilationProblemHandler.
Note: Not all compilers might support this notification mechanism.
- Returns:
- always a CompilationResult
createDefaultSettings
public JavaCompilerSettings createDefaultSettings()
- Description copied from interface:
JavaCompiler
- factory method to create the underlying default settings
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.