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 CharArrayWriterprotected ArrayList<Jsr199JavaCompiler.BytecodeFile> private JspCompilationContextprivate ErrorDispatcherprotected Stringprotected Stringprivate JspRuntimeContext -
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.protected JavaFileManagergetJavaWriter(String javaFileName, String javaEncoding) Get a Writer for the Java file.protected JavaFileObjectgetOutputFile(String className, URI uri) voidinit(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> path) Java Compiler options.voidsetDebug(boolean debug) voidsetExtdirs(String exts) voidsetSourceVM(String sourceVM) voidsetTargetVM(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:JavaCompilerInitializations- Specified by:
initin interfaceJavaCompiler
-
release
public void release()Description copied from interface:JavaCompilerRelease resouces used in the current compilation- Specified by:
releasein interfaceJavaCompiler
-
setClassPath
Description copied from interface:JavaCompilerJava Compiler options.- Specified by:
setClassPathin interfaceJavaCompiler
-
setExtdirs
- Specified by:
setExtdirsin interfaceJavaCompiler
-
setSourceVM
- Specified by:
setSourceVMin interfaceJavaCompiler
-
setTargetVM
- Specified by:
setTargetVMin interfaceJavaCompiler
-
saveClassFile
Description copied from interface:JavaCompilerSave the generated class file to disk, if not already done.- Specified by:
saveClassFilein interfaceJavaCompiler
-
doJavaFile
Description copied from interface:JavaCompilerRemove/save the generated Java File from/to disk- Specified by:
doJavaFilein interfaceJavaCompiler- Throws:
JasperException
-
setDebug
public void setDebug(boolean debug) - Specified by:
setDebugin 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
-
getClassLastModified
public long getClassLastModified()Description copied from interface:JavaCompilerReturn the time the class file was generated.- Specified by:
getClassLastModifiedin interfaceJavaCompiler
-
compile
Description copied from interface:JavaCompilerStart Java compilation- Specified by:
compilein interfaceJavaCompiler- Parameters:
className- Name of the class under compilation- Throws:
JasperException
-
getOutputFile
-
getJavaFileManager
-