public class JDTJavaCompiler extends java.lang.Object implements JavaCompiler
Modifier and Type | Field and Description |
---|---|
private JspCompilationContext |
ctxt |
private ErrorDispatcher |
errDispatcher |
private static java.lang.reflect.Method |
GET_PROBLEM_METH |
private java.lang.String |
javaFileName |
private java.util.logging.Logger |
log |
private java.util.Map |
settings |
private static boolean |
USE_INTROSPECTION_TO_INVOKE_GET_PROBLEM |
Constructor and Description |
---|
JDTJavaCompiler() |
Modifier and Type | Method and Description |
---|---|
JavacErrorDetail[] |
compile(java.lang.String targetClassName,
Node.Nodes pageNodes)
Start Java compilation
|
void |
doJavaFile(boolean keep)
Remove/save the generated Java File from/to disk
|
long |
getClassLastModified()
Return the time the class file was generated.
|
java.io.Writer |
getJavaWriter(java.lang.String javaFileName,
java.lang.String javaEncoding)
Get a Writer for the Java file.
|
void |
init(JspCompilationContext ctxt,
ErrorDispatcher errDispatcher,
boolean suppressLogging)
Initializations
|
void |
release()
Release resouces used in the current compilation
|
private static org.eclipse.jdt.core.compiler.IProblem[] |
safeGetProblems(org.eclipse.jdt.internal.compiler.CompilationResult result)
Invoke CompilationResult#getProblems safely so that it works with
3.1.1 and more recent versions of the eclipse java compiler.
|
void |
saveClassFile(java.lang.String className,
java.lang.String classFileName)
Save the generated class file to disk, if not already done.
|
void |
setClassPath(java.util.List<java.io.File> cpath)
Java Compiler options.
|
void |
setDebug(boolean debug) |
void |
setExtdirs(java.lang.String exts) |
void |
setSourceVM(java.lang.String sourceVM) |
void |
setTargetVM(java.lang.String targetVM) |
private final java.util.Map settings
private JspCompilationContext ctxt
private ErrorDispatcher errDispatcher
private java.util.logging.Logger log
private java.lang.String javaFileName
private static boolean USE_INTROSPECTION_TO_INVOKE_GET_PROBLEM
private static java.lang.reflect.Method GET_PROBLEM_METH
public void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging)
JavaCompiler
init
in interface JavaCompiler
public void release()
JavaCompiler
release
in interface JavaCompiler
public void setExtdirs(java.lang.String exts)
setExtdirs
in interface JavaCompiler
public void setClassPath(java.util.List<java.io.File> cpath)
JavaCompiler
setClassPath
in interface JavaCompiler
public long getClassLastModified()
JavaCompiler
getClassLastModified
in interface JavaCompiler
public java.io.Writer getJavaWriter(java.lang.String javaFileName, java.lang.String javaEncoding) throws JasperException
JavaCompiler
getJavaWriter
in interface JavaCompiler
JasperException
public void setDebug(boolean debug)
setDebug
in interface JavaCompiler
public void setSourceVM(java.lang.String sourceVM)
setSourceVM
in interface JavaCompiler
public void setTargetVM(java.lang.String targetVM)
setTargetVM
in interface JavaCompiler
public void saveClassFile(java.lang.String className, java.lang.String classFileName)
JavaCompiler
saveClassFile
in interface JavaCompiler
public void doJavaFile(boolean keep)
JavaCompiler
doJavaFile
in interface JavaCompiler
public JavacErrorDetail[] compile(java.lang.String targetClassName, Node.Nodes pageNodes) throws JasperException
JavaCompiler
compile
in interface JavaCompiler
targetClassName
- Name of the class under compilationJasperException
private static final org.eclipse.jdt.core.compiler.IProblem[] safeGetProblems(org.eclipse.jdt.internal.compiler.CompilationResult result)
result
- The compilation result.