org.apache.jasper.compiler

Class Compiler


public class Compiler
extends java.lang.Object

Main JSP compiler class. This class uses Ant for compiling.

Authors:
Anil K. Vijendran
Mandar Raje
Pierre Delisle
Kin-man Chung
Remy Maucherat
Mark Roth

Field Summary

protected JspCompilationContext
ctxt
protected Options
options
protected Node.Nodes
pageNodes
protected Project
project

Constructor Summary

Compiler(JspCompilationContext ctxt)
Compiler(JspCompilationContext ctxt, JspServletWrapper jsw)

Method Summary

void
compile()
Compile the jsp file from the current engine context
void
compile(boolean compileClass)
Compile the jsp file from the current engine context.
void
compile(boolean compileClass, boolean jspcMode)
Compile the jsp file from the current engine context.
JspCompilationContext
getCompilationContext()
ErrorDispatcher
getErrorDispatcher()
Gets the error dispatcher.
org.apache.jasper.compiler.PageInfo
getPageInfo()
Gets the info about the page under compilation
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

Field Details

ctxt

protected JspCompilationContext ctxt


options

protected Options options


pageNodes

protected Node.Nodes pageNodes


project

protected Project project

Constructor Details

Compiler

public Compiler(JspCompilationContext ctxt)


Compiler

public Compiler(JspCompilationContext ctxt,
                JspServletWrapper jsw)

Method Details

compile

public void compile()
            throws FileNotFoundException,
                   JasperException,
                   Exception
Compile the jsp file from the current engine context


compile

public void compile(boolean compileClass)
            throws FileNotFoundException,
                   JasperException,
                   Exception
Compile the jsp file from the current engine context. As an side- effect, tag files that are referenced by this page are also compiled.

Parameters:
compileClass - If true, generate both .java and .class file If false, generate only .java file


compile

public void compile(boolean compileClass,
                    boolean jspcMode)
            throws FileNotFoundException,
                   JasperException,
                   Exception
Compile the jsp file from the current engine context. As an side- effect, tag files that are referenced by this page are also compiled.

Parameters:
compileClass - If true, generate both .java and .class file If false, generate only .java file
jspcMode - true if invoked from JspC, false otherwise


getCompilationContext

public JspCompilationContext getCompilationContext()


getErrorDispatcher

public ErrorDispatcher getErrorDispatcher()
Gets the error dispatcher.


getPageInfo

public org.apache.jasper.compiler.PageInfo getPageInfo()
Gets the info about the page under compilation


isOutDated

public boolean isOutDated()
This is a protected method intended to be overridden by subclasses of Compiler. This is used by the compile method to do all the compilation.


isOutDated

public 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. If the page has dependencies, the check is also extended to its dependeants, and so on. This method can by overidden by a subclasses of Compiler.

Parameters:
checkClass - If true, check against .class file, if false, check against .java file.


removeGeneratedClassFiles

public void removeGeneratedClassFiles()


removeGeneratedFiles

public void removeGeneratedFiles()
Remove generated files


Copyright B) 2000 Apache Software Foundation. All Rights Reserved.