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) classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JspCompilationContextprivate ErrorDispatcherprivate StringBuilderprivate org.apache.tools.ant.taskdefs.Javacprivate static final Stringprivate Stringprivate Stringprivate static Stringprivate Loggerprivate AntJavaCompiler.JasperAntLoggerprivate Optionsprivate org.apache.tools.ant.Projectprivate static ThreadFactoryprivate static ExecutorService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompile(String className, Node.Nodes pageNodes) Start Java compilationvoiddoJavaFile(boolean keep) Remove/save the generated Java File from/to disklongReturn the time the class file was generated.getJavaWriter(String javaFileName, String javaEncoding) Get a Writer for the Java file.private org.apache.tools.ant.Projectvoidinit(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging) Initializationsvoidrelease()Release resouces used in the current compilationvoidsaveClassFile(String className, String classFileName) Save the generated class file to disk, if not already done.voidsetClassPath(List<File> cpath) Java Compiler options.voidsetDebug(boolean debug) voidsetExtdirs(String exts) voidsetSourceVM(String sourceVM) voidsetTargetVM(String targetVM) static voidstatic 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:JavaCompilerInitializations- Specified by:
initin interfaceJavaCompiler
-
release
public void release()Description copied from interface:JavaCompilerRelease resouces used in the current compilation- Specified by:
releasein interfaceJavaCompiler
-
setExtdirs
- Specified by:
setExtdirsin interfaceJavaCompiler
-
setTargetVM
- Specified by:
setTargetVMin interfaceJavaCompiler
-
setSourceVM
- Specified by:
setSourceVMin interfaceJavaCompiler
-
setClassPath
Description copied from interface:JavaCompilerJava Compiler options.- Specified by:
setClassPathin interfaceJavaCompiler
-
saveClassFile
Description copied from interface:JavaCompilerSave the generated class file to disk, if not already done.- Specified by:
saveClassFilein interfaceJavaCompiler
-
setDebug
public void setDebug(boolean debug) - Specified by:
setDebugin interfaceJavaCompiler
-
getClassLastModified
public long getClassLastModified()Description copied from interface:JavaCompilerReturn the time the class file was generated.- Specified by:
getClassLastModifiedin interfaceJavaCompiler
-
getJavaWriter
Description copied from interface:JavaCompilerGet 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:
getJavaWriterin interfaceJavaCompiler- Throws:
JasperException
-
compile
Description copied from interface:JavaCompilerStart Java compilation- Specified by:
compilein interfaceJavaCompiler- Parameters:
className- Name of the class under compilation- Throws:
JasperException
-
doJavaFile
public void doJavaFile(boolean keep) Description copied from interface:JavaCompilerRemove/save the generated Java File from/to disk- Specified by:
doJavaFilein interfaceJavaCompiler
-
startThreadPool
public static void startThreadPool() -
shutdownThreadPool
public static void shutdownThreadPool()
-