Package org.apache.jasper.compiler
Class Jsr199JavaCompiler
java.lang.Object
org.apache.jasper.compiler.Jsr199JavaCompiler
- All Implemented Interfaces:
JavaCompiler
Invoke Java Compiler per JSR 199, using in-memory storage for both the
input Java source and the generated bytecodes.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CharArrayWriter
protected ArrayList
<Jsr199JavaCompiler.BytecodeFile> private JspCompilationContext
private ErrorDispatcher
protected String
protected String
private JspRuntimeContext
-
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.protected JavaFileManager
getJavaWriter
(String javaFileName, String javaEncoding) Get a Writer for the Java file.protected JavaFileObject
getOutputFile
(String className, URI uri) 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> path) Java Compiler options.void
setDebug
(boolean debug) void
setExtdirs
(String exts) void
setSourceVM
(String sourceVM) void
setTargetVM
(String targetVM)
-
Field Details
-
cpath
-
rtctxt
-
classFiles
-
options
-
charArrayWriter
-
ctxt
-
javaFileName
-
javaEncoding
-
errDispatcher
-
-
Constructor Details
-
Jsr199JavaCompiler
public Jsr199JavaCompiler()
-
-
Method Details
-
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
-
setClassPath
Description copied from interface:JavaCompiler
Java Compiler options.- Specified by:
setClassPath
in interfaceJavaCompiler
-
setExtdirs
- Specified by:
setExtdirs
in interfaceJavaCompiler
-
setSourceVM
- Specified by:
setSourceVM
in interfaceJavaCompiler
-
setTargetVM
- Specified by:
setTargetVM
in interfaceJavaCompiler
-
saveClassFile
Description copied from interface:JavaCompiler
Save the generated class file to disk, if not already done.- Specified by:
saveClassFile
in interfaceJavaCompiler
-
doJavaFile
Description copied from interface:JavaCompiler
Remove/save the generated Java File from/to disk- Specified by:
doJavaFile
in interfaceJavaCompiler
- Throws:
JasperException
-
setDebug
public void setDebug(boolean debug) - Specified by:
setDebug
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
-
getClassLastModified
public long getClassLastModified()Description copied from interface:JavaCompiler
Return the time the class file was generated.- Specified by:
getClassLastModified
in interfaceJavaCompiler
-
compile
Description copied from interface:JavaCompiler
Start Java compilation- Specified by:
compile
in interfaceJavaCompiler
- Parameters:
className
- Name of the class under compilation- Throws:
JasperException
-
getOutputFile
-
getJavaFileManager
-