org.apache.jasper.compiler
Class Jsr199JavaCompiler

java.lang.Object
  extended by org.apache.jasper.compiler.Jsr199JavaCompiler

public class Jsr199JavaCompiler
extends java.lang.Object

Invoke Java Compiler per JSR 199, using in-memory storage for both the input Java source and the generated bytecodes.

Author:
Kin-man Chung

Constructor Summary
Jsr199JavaCompiler()
           
 
Method Summary
 JavacErrorDetail[] compile(java.lang.String className, Node.Nodes pageNodes)
          Start Java compilation
 void doJavaFile(boolean keep)
          Remove/save the generated Java File from/to disk
 long getClassLastModified()
          Return the time the class file was generated.
 java.io.Writer getJavaWriter(java.lang.String javaFileName, java.lang.String javaEncoding)
          Get a Writer for the Java file.
 void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging)
          Initializations
 void saveClassFile(java.lang.String className, java.lang.String classFileName)
          Save the generated class file to disk, if not already done.
 void setClassPath(java.util.List<java.io.File> path)
          Java Compiler options.
 void setDebug(boolean debug)
           
 void setExtdirs(java.lang.String exts)
           
 void setSourceVM(java.lang.String sourceVM)
           
 void setTargetVM(java.lang.String targetVM)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jsr199JavaCompiler

public Jsr199JavaCompiler()
Method Detail

init

public void init(JspCompilationContext ctxt,
                 ErrorDispatcher errDispatcher,
                 boolean suppressLogging)
Initializations


setClassPath

public void setClassPath(java.util.List<java.io.File> path)
Java Compiler options.


setExtdirs

public void setExtdirs(java.lang.String exts)

setSourceVM

public void setSourceVM(java.lang.String sourceVM)

setTargetVM

public void setTargetVM(java.lang.String targetVM)

saveClassFile

public void saveClassFile(java.lang.String className,
                          java.lang.String classFileName)
Save the generated class file to disk, if not already done.


doJavaFile

public void doJavaFile(boolean keep)
                throws JasperException
Remove/save the generated Java File from/to disk

Throws:
JasperException

setDebug

public void setDebug(boolean debug)

getJavaWriter

public java.io.Writer getJavaWriter(java.lang.String javaFileName,
                                    java.lang.String javaEncoding)
Get 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.


getClassLastModified

public long getClassLastModified()
Return the time the class file was generated.


compile

public JavacErrorDetail[] compile(java.lang.String className,
                                  Node.Nodes pageNodes)
                           throws JasperException
Start Java compilation

Parameters:
className - Name of the class under compilation
Throws:
JasperException


Copyright © 2009 GlassFish Community. All Rights Reserved.