public class Compiler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected JspCompilationContext |
ctxt |
private ErrorDispatcher |
errDispatcher |
private JavaCompiler |
javaCompiler |
private boolean |
javaCompilerOptionsSet |
private boolean |
jspcMode |
private long |
jspModTime |
private JspServletWrapper |
jsw |
private java.util.logging.Logger |
log |
private Options |
options |
private PageInfo |
pageInfo |
private Node.Nodes |
pageNodes |
private SmapUtil |
smapUtil |
private static java.lang.String[] |
systemJars |
private static java.lang.String[] |
systemJsfJars |
private TagFileProcessor |
tfp |
Constructor and Description |
---|
Compiler(JspCompilationContext ctxt,
JspServletWrapper jsw) |
Compiler(JspCompilationContext ctxt,
JspServletWrapper jsw,
boolean jspcMode) |
Modifier and Type | Method and Description |
---|---|
void |
compile(boolean compileClass)
Compile the jsp file from the current engine context.
|
private void |
generateClass()
Compile the servlet from .java file to .class file
|
private void |
generateJava()
Compile the jsp file into equivalent servlet in java source
|
private java.lang.Class |
getClassFor(java.lang.String className) |
JspCompilationContext |
getCompilationContext() |
ErrorDispatcher |
getErrorDispatcher()
Gets the error dispatcher.
|
PageInfo |
getPageInfo()
Gets the info about the page under compilation
|
private void |
initJavaCompiler()
Get an instance of JavaCompiler.
|
boolean |
isOutDated()
This is a protected method intended to be overridden by
subclasses of Compiler.
|
boolean |
isOutDated(boolean checkClass)
Determine if a compilation is necessary by checking the time stamp
of the JSP page with that of the corresponding .class or .java file.
|
void |
removeGeneratedClassFiles() |
void |
removeGeneratedFiles()
Remove generated files
|
private void |
setJavaCompilerOptions() |
void |
setPageInfo(PageInfo pageInfo)
Sets the info about the page under compilation
|
private boolean |
systemJarInWebinf(java.lang.String path)
Return true if the path refers to a jar file in WEB-INF and is a
system jar.
|
protected JspCompilationContext ctxt
private ErrorDispatcher errDispatcher
private PageInfo pageInfo
private JspServletWrapper jsw
private TagFileProcessor tfp
private JavaCompiler javaCompiler
private java.util.logging.Logger log
private boolean jspcMode
private SmapUtil smapUtil
private Options options
private Node.Nodes pageNodes
private long jspModTime
private boolean javaCompilerOptionsSet
private static java.lang.String[] systemJars
private static java.lang.String[] systemJsfJars
public Compiler(JspCompilationContext ctxt, JspServletWrapper jsw)
public Compiler(JspCompilationContext ctxt, JspServletWrapper jsw, boolean jspcMode) throws JasperException
JasperException
private void generateJava() throws java.lang.Exception
java.lang.Exception
private void setJavaCompilerOptions()
private void generateClass() throws java.io.FileNotFoundException, JasperException, java.lang.Exception
java.io.FileNotFoundException
JasperException
java.lang.Exception
public void compile(boolean compileClass) throws java.io.FileNotFoundException, JasperException, java.lang.Exception
compileClass
- If true, generate both .java and .class file
If false, generate only .java filejava.io.FileNotFoundException
JasperException
java.lang.Exception
public boolean isOutDated()
public boolean isOutDated(boolean checkClass)
checkClass
- If true, check against .class file,
if false, check against .java file.public ErrorDispatcher getErrorDispatcher()
public PageInfo getPageInfo()
public void setPageInfo(PageInfo pageInfo)
public JspCompilationContext getCompilationContext()
public void removeGeneratedFiles()
public void removeGeneratedClassFiles()
private void initJavaCompiler() throws JasperException
JasperException
private java.lang.Class getClassFor(java.lang.String className)
private boolean systemJarInWebinf(java.lang.String path)