Package org.apache.jasper.compiler
Class NullJavaCompiler
- java.lang.Object
-
- org.apache.jasper.compiler.NullJavaCompiler
-
- All Implemented Interfaces:
JavaCompiler
public class NullJavaCompiler extends java.lang.Object implements JavaCompiler
Java compiler for invoking JSP to java translation only. This only implements the part of JavaCompiler that handles the writing of the generated Java file.
-
-
Field Summary
Fields Modifier and Type Field Description private JspCompilationContext
ctxt
private ErrorDispatcher
errDispatcher
private java.lang.String
javaEncoding
private java.lang.String
javaFileName
-
Constructor Summary
Constructors Constructor Description NullJavaCompiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavacErrorDetail[]
compile(java.lang.String className, Node.Nodes pageNodes)
Start Java compilationvoid
doJavaFile(boolean keep)
Remove/save the generated Java File from/to disklong
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)
Initializationsvoid
release()
Release resouces used in the current compilationvoid
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)
-
-
-
Field Detail
-
ctxt
private JspCompilationContext ctxt
-
errDispatcher
private ErrorDispatcher errDispatcher
-
javaFileName
private java.lang.String javaFileName
-
javaEncoding
private java.lang.String javaEncoding
-
-
Method Detail
-
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
public void setExtdirs(java.lang.String exts)
- Specified by:
setExtdirs
in interfaceJavaCompiler
-
setTargetVM
public void setTargetVM(java.lang.String targetVM)
- Specified by:
setTargetVM
in interfaceJavaCompiler
-
setSourceVM
public void setSourceVM(java.lang.String sourceVM)
- Specified by:
setSourceVM
in interfaceJavaCompiler
-
setClassPath
public void setClassPath(java.util.List<java.io.File> cpath)
Description copied from interface:JavaCompiler
Java Compiler options.- Specified by:
setClassPath
in interfaceJavaCompiler
-
saveClassFile
public void saveClassFile(java.lang.String className, java.lang.String classFileName)
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
public java.io.Writer getJavaWriter(java.lang.String javaFileName, java.lang.String javaEncoding) throws JasperException
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
public JavacErrorDetail[] compile(java.lang.String className, Node.Nodes pageNodes) throws JasperException
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
-
-