Class Compiler
java.lang.Object
org.apache.sling.scripting.jsp.jasper.compiler.Compiler
- Direct Known Subclasses:
JDTCompiler
Main JSP compiler class. This class uses Ant for compiling.
- Author:
- Anil K. Vijendran, Mandar Raje, Pierre Delisle, Kin-man Chung, Remy Maucherat, Mark Roth
-
Field Summary
Modifier and TypeFieldDescriptionprotected final JspCompilationContext
protected ErrorDispatcher
protected Log
protected PageInfo
protected org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes
protected org.apache.sling.scripting.jsp.jasper.compiler.TagFileProcessor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clean()
void
compile()
Compile the jsp file from the current engine contextvoid
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.protected abstract void
generateClass
(String[] smap) Compile the servlet from .java file to .class fileprotected String[]
Compile the jsp file into equivalent servlet in .java fileGets the error dispatcher.Gets the info about the page under compilationorg.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes
Retrieves the parsed nodes of the JSP page, if they are available.void
void
Remove generated files
-
Field Details
-
log
-
ctxt
-
errDispatcher
-
pageInfo
-
tfp
protected org.apache.sling.scripting.jsp.jasper.compiler.TagFileProcessor tfp -
pageNodes
protected org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes pageNodes
-
-
Constructor Details
-
Compiler
-
-
Method Details
-
getPageNodes
public org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes getPageNodes()Retrieves the parsed nodes of the JSP page, if they are available. May return null. Used in development mode for generating detailed error messages. http://issues.apache.org/bugzilla/show_bug.cgi?id=37062.
-
generateJava
Compile the jsp file into equivalent servlet in .java file- Returns:
- a smap for the current JSP page, if one is generated, null otherwise
- Throws:
Exception
-
generateClass
protected abstract void generateClass(String[] smap) throws FileNotFoundException, JasperException, Exception Compile the servlet from .java file to .class file -
compile
Compile the jsp file from the current engine context -
compile
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- Throws:
FileNotFoundException
JasperException
Exception
-
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 filejspcMode
- true if invoked from JspC, false otherwise- Throws:
FileNotFoundException
JasperException
Exception
-
getErrorDispatcher
Gets the error dispatcher. -
getPageInfo
Gets the info about the page under compilation -
getCompilationContext
-
removeGeneratedFiles
public void removeGeneratedFiles()Remove generated files -
removeGeneratedClassFiles
public void removeGeneratedClassFiles() -
clean
public void clean()
-