org.apache.jasper.compiler
类 JDTJavaCompiler

java.lang.Object
  继承者 org.apache.jasper.compiler.JDTJavaCompiler

public class JDTJavaCompiler
extends Object

JDT class compiler. This compiler will load source dependencies from the context classloader, reducing dramatically disk access during the compilation process.

作者:
Cocoon2, Remy Maucherat, Kin-man Chung Modified to implement JavaCompiler

构造方法摘要
JDTJavaCompiler()
           
 
方法摘要
 JavacErrorDetail[] compile(String targetClassName, 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.
 Writer getJavaWriter(String javaFileName, String javaEncoding)
          Get a Writer for the Java file.
 void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging)
          Initializations
 void release()
          Release resouces used in the current compilation
 void saveClassFile(String className, String classFileName)
          Save the generated class file to disk, if not already done.
 void setClassPath(List<File> cpath)
          Java Compiler options.
 void setDebug(boolean debug)
           
 void setExtdirs(String exts)
           
 void setSourceVM(String sourceVM)
           
 void setTargetVM(String targetVM)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JDTJavaCompiler

public JDTJavaCompiler()
方法详细信息

init

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


release

public void release()
Release resouces used in the current compilation


setExtdirs

public void setExtdirs(String exts)

setClassPath

public void setClassPath(List<File> cpath)
Java Compiler options.


getClassLastModified

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


getJavaWriter

public Writer getJavaWriter(String javaFileName,
                            String javaEncoding)
                     throws JasperException
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.

抛出:
JasperException

setDebug

public void setDebug(boolean debug)

setSourceVM

public void setSourceVM(String sourceVM)

setTargetVM

public void setTargetVM(String targetVM)

saveClassFile

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


doJavaFile

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


compile

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

参数:
targetClassName - Name of the class under compilation
抛出:
JasperException


Copyright © 2013. All Rights Reserved.