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
FieldsModifier and TypeFieldDescriptionprotected final JspCompilationContextprotected ErrorDispatcherprotected Logprotected PageInfoprotected org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodesprotected org.apache.sling.scripting.jsp.jasper.compiler.TagFileProcessor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()voidcompile()Compile the jsp file from the current engine contextvoidcompile(boolean compileClass) Compile the jsp file from the current engine context.voidcompile(boolean compileClass, boolean jspcMode) Compile the jsp file from the current engine context.protected abstract voidgenerateClass(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.NodesRetrieves the parsed nodes of the JSP page, if they are available.voidvoidRemove 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:
FileNotFoundExceptionJasperExceptionException
-
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:
FileNotFoundExceptionJasperExceptionException
-
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()
-