Package org.apache.jasper.compiler
Class AntJavaCompiler
- java.lang.Object
-
- org.apache.jasper.compiler.AntJavaCompiler
-
- All Implemented Interfaces:
JavaCompiler
public class AntJavaCompiler extends java.lang.Object implements JavaCompiler
Java compiler through ant
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classAntJavaCompiler.JasperAntLoggerprivate static classAntJavaCompiler.JavacObjprivate static classAntJavaCompiler.JavacThreadFactory
-
Field Summary
Fields Modifier and Type Field Description private JspCompilationContextctxtprivate ErrorDispatchererrDispatcherprivate java.lang.StringBuilderinfoprivate org.apache.tools.ant.taskdefs.Javacjavacprivate static java.lang.StringJAVAC_THREAD_PREFIXprivate java.lang.StringjavaEncodingprivate java.lang.StringjavaFileNameprivate static java.lang.StringlineSeparatorprivate java.util.logging.Loggerlogprivate AntJavaCompiler.JasperAntLoggerloggerprivate Optionsoptionsprivate org.apache.tools.ant.Projectprojectprivate static java.util.concurrent.ThreadFactorythreadFactoryprivate static java.util.concurrent.ExecutorServicethreadPool
-
Constructor Summary
Constructors Constructor Description AntJavaCompiler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JavacErrorDetail[]compile(java.lang.String className, Node.Nodes pageNodes)Start Java compilationvoiddoJavaFile(boolean keep)Remove/save the generated Java File from/to disklonggetClassLastModified()Return the time the class file was generated.java.io.WritergetJavaWriter(java.lang.String javaFileName, java.lang.String javaEncoding)Get a Writer for the Java file.private org.apache.tools.ant.ProjectgetProject()voidinit(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging)Initializationsvoidrelease()Release resouces used in the current compilationvoidsaveClassFile(java.lang.String className, java.lang.String classFileName)Save the generated class file to disk, if not already done.voidsetClassPath(java.util.List<java.io.File> cpath)Java Compiler options.voidsetDebug(boolean debug)voidsetExtdirs(java.lang.String exts)voidsetSourceVM(java.lang.String sourceVM)voidsetTargetVM(java.lang.String targetVM)static voidshutdownThreadPool()static voidstartThreadPool()
-
-
-
Field Detail
-
logger
private AntJavaCompiler.JasperAntLogger logger
-
javac
private org.apache.tools.ant.taskdefs.Javac javac
-
project
private org.apache.tools.ant.Project project
-
ctxt
private JspCompilationContext ctxt
-
options
private Options options
-
errDispatcher
private ErrorDispatcher errDispatcher
-
javaFileName
private java.lang.String javaFileName
-
javaEncoding
private java.lang.String javaEncoding
-
info
private java.lang.StringBuilder info
-
log
private java.util.logging.Logger log
-
threadPool
private static java.util.concurrent.ExecutorService threadPool
-
threadFactory
private static java.util.concurrent.ThreadFactory threadFactory
-
JAVAC_THREAD_PREFIX
private static final java.lang.String JAVAC_THREAD_PREFIX
- See Also:
- Constant Field Values
-
lineSeparator
private static java.lang.String lineSeparator
-
-
Method Detail
-
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
public void setExtdirs(java.lang.String exts)
- Specified by:
setExtdirsin interfaceJavaCompiler
-
setTargetVM
public void setTargetVM(java.lang.String targetVM)
- Specified by:
setTargetVMin interfaceJavaCompiler
-
setSourceVM
public void setSourceVM(java.lang.String sourceVM)
- Specified by:
setSourceVMin interfaceJavaCompiler
-
setClassPath
public void setClassPath(java.util.List<java.io.File> cpath)
Description copied from interface:JavaCompilerJava Compiler options.- Specified by:
setClassPathin interfaceJavaCompiler
-
saveClassFile
public void saveClassFile(java.lang.String className, java.lang.String classFileName)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
public java.io.Writer getJavaWriter(java.lang.String javaFileName, java.lang.String javaEncoding) throws JasperExceptionDescription 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
public JavacErrorDetail[] compile(java.lang.String className, Node.Nodes pageNodes) throws JasperException
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()
-
-