public class AntJavaCompiler extends java.lang.Object implements JavaCompiler
Modifier and Type | Class and Description |
---|---|
(package private) class |
AntJavaCompiler.JasperAntLogger |
private static class |
AntJavaCompiler.JavacObj |
private static class |
AntJavaCompiler.JavacThreadFactory |
Modifier and Type | Field and Description |
---|---|
private JspCompilationContext |
ctxt |
private ErrorDispatcher |
errDispatcher |
private java.lang.StringBuilder |
info |
private Javac |
javac |
private static java.lang.String |
JAVAC_THREAD_PREFIX |
private java.lang.String |
javaEncoding |
private java.lang.String |
javaFileName |
private static java.lang.String |
lineSeparator |
private java.util.logging.Logger |
log |
private AntJavaCompiler.JasperAntLogger |
logger |
private Options |
options |
private Project |
project |
private static java.util.concurrent.ThreadFactory |
threadFactory |
private static java.util.concurrent.ExecutorService |
threadPool |
Constructor and Description |
---|
AntJavaCompiler() |
Modifier and Type | Method and Description |
---|---|
JavacErrorDetail[] |
compile(java.lang.String className,
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.
|
private Project |
getProject() |
void |
init(JspCompilationContext ctxt,
ErrorDispatcher errDispatcher,
boolean suppressLogging)
Initializations
|
void |
release()
Release resouces used in the current compilation
|
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) |
static void |
shutdownThreadPool() |
static void |
startThreadPool() |
private AntJavaCompiler.JasperAntLogger logger
private Javac javac
private Project project
private JspCompilationContext ctxt
private Options options
private ErrorDispatcher errDispatcher
private java.lang.String javaFileName
private java.lang.String javaEncoding
private java.lang.StringBuilder info
private java.util.logging.Logger log
private static java.util.concurrent.ExecutorService threadPool
private static java.util.concurrent.ThreadFactory threadFactory
private static final java.lang.String JAVAC_THREAD_PREFIX
private static java.lang.String lineSeparator
private Project getProject()
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 setTargetVM(java.lang.String targetVM)
setTargetVM
in interface JavaCompiler
public void setSourceVM(java.lang.String sourceVM)
setSourceVM
in interface JavaCompiler
public void setClassPath(java.util.List<java.io.File> cpath)
JavaCompiler
setClassPath
in interface JavaCompiler
public void saveClassFile(java.lang.String className, java.lang.String classFileName)
JavaCompiler
saveClassFile
in interface JavaCompiler
public void setDebug(boolean debug)
setDebug
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 JavacErrorDetail[] compile(java.lang.String className, Node.Nodes pageNodes) throws JasperException
JavaCompiler
compile
in interface JavaCompiler
className
- Name of the class under compilationJasperException
public void doJavaFile(boolean keep)
JavaCompiler
doJavaFile
in interface JavaCompiler
public static void startThreadPool()
public static void shutdownThreadPool()