Package org.apache.jasper.compiler
Class AntJavaCompiler
java.lang.Object
org.apache.jasper.compiler.AntJavaCompiler
- All Implemented Interfaces:
JavaCompiler
Java compiler through ant
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JspCompilationContext
private ErrorDispatcher
private StringBuilder
private org.apache.tools.ant.taskdefs.Javac
private static final String
private String
private String
private static String
private Logger
private AntJavaCompiler.JasperAntLogger
private Options
private org.apache.tools.ant.Project
private static ThreadFactory
private static ExecutorService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompile
(String className, Node.Nodes pageNodes) Start Java compilationvoid
doJavaFile
(boolean keep) Remove/save the generated Java File from/to disklong
Return the time the class file was generated.getJavaWriter
(String javaFileName, String javaEncoding) Get a Writer for the Java file.private org.apache.tools.ant.Project
void
init
(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging) Initializationsvoid
release()
Release resouces used in the current compilationvoid
saveClassFile
(String className, String classFileName) Save the generated class file to disk, if not already done.void
setClassPath
(List<File> cpath) Java Compiler options.void
setDebug
(boolean debug) void
setExtdirs
(String exts) void
setSourceVM
(String sourceVM) void
setTargetVM
(String targetVM) static void
static void
-
Field Details
-
logger
-
javac
private org.apache.tools.ant.taskdefs.Javac javac -
project
private org.apache.tools.ant.Project project -
ctxt
-
options
-
errDispatcher
-
javaFileName
-
javaEncoding
-
info
-
log
-
threadPool
-
threadFactory
-
JAVAC_THREAD_PREFIX
- See Also:
-
lineSeparator
-
-
Constructor Details
-
AntJavaCompiler
public AntJavaCompiler()
-
-
Method Details
-
getProject
private org.apache.tools.ant.Project getProject() -
init
public void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging) Description copied from interface:JavaCompiler
Initializations- Specified by:
init
in interfaceJavaCompiler
-
release
public void release()Description copied from interface:JavaCompiler
Release resouces used in the current compilation- Specified by:
release
in interfaceJavaCompiler
-
setExtdirs
- Specified by:
setExtdirs
in interfaceJavaCompiler
-
setTargetVM
- Specified by:
setTargetVM
in interfaceJavaCompiler
-
setSourceVM
- Specified by:
setSourceVM
in interfaceJavaCompiler
-
setClassPath
Description copied from interface:JavaCompiler
Java Compiler options.- Specified by:
setClassPath
in interfaceJavaCompiler
-
saveClassFile
Description copied from interface:JavaCompiler
Save the generated class file to disk, if not already done.- Specified by:
saveClassFile
in interfaceJavaCompiler
-
setDebug
public void setDebug(boolean debug) - Specified by:
setDebug
in interfaceJavaCompiler
-
getClassLastModified
public long getClassLastModified()Description copied from interface:JavaCompiler
Return the time the class file was generated.- Specified by:
getClassLastModified
in interfaceJavaCompiler
-
getJavaWriter
Description copied from interface:JavaCompiler
Get a Writer for the Java file. The writer is used by JSP compiler. This method allows the Java compiler control where the Java file should be generated so it knows how to handle the input for java compilation accordingly.- Specified by:
getJavaWriter
in interfaceJavaCompiler
- Throws:
JasperException
-
compile
Description copied from interface:JavaCompiler
Start Java compilation- Specified by:
compile
in interfaceJavaCompiler
- Parameters:
className
- Name of the class under compilation- Throws:
JasperException
-
doJavaFile
public void doJavaFile(boolean keep) Description copied from interface:JavaCompiler
Remove/save the generated Java File from/to disk- Specified by:
doJavaFile
in interfaceJavaCompiler
-
startThreadPool
public static void startThreadPool() -
shutdownThreadPool
public static void shutdownThreadPool()
-